260 likes | 431 Views
Getting started with Rational Engineering Lifecycle Manager queries. Andy Lapping – Technical sales and solutions Joanne Scouler – Curriculum architect. Agenda. Linked data and Open Services for Lifecycle Collaboration (OSLC) The information model Basic concepts and terminology Linked data
E N D
Getting started with Rational Engineering Lifecycle Manager queries Andy Lapping – Technical sales and solutions Joanne Scouler – Curriculum architect
Agenda Linked data and Open Services for Lifecycle Collaboration (OSLC) The information model Basic concepts and terminology • Linked data • RDF • Triples • SPARQL Creating queries– live demo
Resources • OSLC resources: • Introduction to Linked Data and OSLC by Amanda Brijpaul • Linked Data by Ben Williams • Linked Data Interfaces by Arthur Ryman • REST resources: • DeveloperWorks REST resources – The Basics • Learn about rest web services • RDF, TRS, SPARQL, LQE- http://www.w3.org
Rational engineering lifecycle manager Project Managers Analysts Quality Professionals Developers Release Engineers Architects Transition to a unified view on project, program & account info Itis about accessing related information in job related tools across the information base to increase the collective wisdom
Linked data in Rational engineering lifecycle manager The Web has proven to be the most scalable, open, and flexible integration technology http://acme.com/Requirement http://acme.com/TestCase about about about about HTTP/REST Test Change Products Mechanical Design / PDM Architecture Requirements Electrical Design EmbeddedSoftware Design
Link directly between tools – no need to import or duplicate data OSLC links
Data is indexed in Rational engineering lifecycle manager • An index of tracked resources is created from domain tools that allows for cross-domain Lifecycle Queries LQE Lifecycle Query Engine (Index)
The information model • What information do you want to find with a query? • Know your information model • Know how your linkages are set up • What do you need to know before writing a query?
Learning the language • RDF – Resource Description Framework • A general purpose language for representing information in the web • SPARQL - SPARQL Protocol and RDF Query Language • A query language for RDF • TRS – Tracked Resource Set • TRS is an OSLC specification that allows server applications to make their resources and changes available to client applications. • LQE – The Lifecycle Query Engine • A TRS client application
Running queries Query results available in http format Pipes (XML) data to Rational Reporting for Document Generation (RRDG) / Rational Publishing Engine (RPE)
Basic concept: triples • A triple defines a relationship between things: • Subject • A uniquely identified thing • Predicate (also called property) • Some attribute of the subject • Denotes a relationship • Object • The actual value
Triples • Examples: subject subject predicate predicate object object
RDF triples • An RDF triple is sometimes called a statement • Every piece of an RDF triple can have a URL • Commonly referred to as a resource http://men.com#William http://relations.com/isMarriedTo http://women.com#Catherine O S P
RDF triples form graphs • A set of triples is called an RDF graph • Graphs have nodes and edges • An RDF database is sometimes called a triple store Edge Node
Types of node • Resource node • A thing with a URL with links • Commonly represented as an oval • Blank node • A resource with no URL with links • Literal node • A value (strings, dates) - no URL and no links • Commonly represented as a rectangle An edge can go from any Node to any other Node. Exception: An edge cannot go from a Literal
Triple patterns A triple pattern is like an RDF triple – except that each of the S,P,O may be a variable (denoted by a preceding ? symbol) ?resourcerdf:typeoslc_qm:TestCase . Variable Variables are like a wildcard – they match any node – resource or literal. The period terminates the statement We will discuss what rdf:type and oslc_qm:TestCase mean in a moment
RDF vocabularies • In order for ‘anything’ to connect to ‘anything else’ – there must be some common language. • An RDF Vocabulary is the set of URLs for the resources in the graph ?resourcehttp://www.w3.org/1999/02/22-rdf-syntax-ns#type http://open-services.net/ns/qm#TestCase From the standard RDF vocabulary From the OSLC Quality Management Vocabulary
Prefixes • Prefixes are used in SPARQL to allow queries to be shortened (instead of writing the full URL to the resource) • The following queries are equivalent ?urihttp://open-services.net/ns/qm#testsChangeRequest?tests_cr. S P O PREFIX oslc_qm: <http://open-services.net/ns/qm#> ?uri oslc_qm:testsChangeRequest?tests_cr. S P O
Anatomy of a query PREFIX oslc_qm: <http://open-services.net/ns/qm#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?uri WHERE { ?uri rdf:type oslc_qm:TestCase . } SELECT?variable ?variable Identifies the variables to appear in the results (this is called projection) Each projected variable will be a column in the results table SELECT * will display all variables specified in the WHERE clause WHERE { basic graph pattern } Identifies the basic graph pattern to match against the data pattern
A simple query with results PREFIX oslc_qm: <http://open-services.net/ns/qm#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?uri WHERE { ?uri rdf:type oslc_qm:TestCase . } Projected ?uri variable Pattern matches
Creating a query • When a query is created some sample SPARQL is added • Although this can be executed the results will mean very little
Blank nodes in Rhapsody Using this technique we can discover how to extract various resources in Rhapsody Some may have multiple blank nodes to traverse