CLM Ontology Part 2 – Sparql

Just a short excursion to Sparql…

Sparql queries could be complex. Very often I struggle to create them or to read existent queries. Let me share my findings:

  • Take the WHERE part of the Sparql query and create a graph. I draw it on simple paper and voilà you will see the search pattern.
  • Also when you start with an new query, create a drawing first and then type the Sparql query.

Example:

PREFIX dc: <http://purl.org/dc/terms/&gt;
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;
PREFIX oslc: <http://open-services.net/ns/core#&gt;
PREFIX oslc_cm: <http://open-services.net/ns/cm#&gt;
PREFIX oslc_qm: <http://open-services.net/ns/qm#&gt;

SELECT ?cm_shortTitle  ?cm_title  ?cm_uri  ?status  ?qm_title  ?qm_uri
WHERE {
?cm_uri oslc:shortTitle ?cm_shortTitle  ;
dc:title ?cm_title  ;
dc:modified ?modified ;
oslc_cm:status ?cm_status ;
oslc_cm:testedByTestCase ?qm_uri .
?qm_uri dc:title ?qm_title  .
}

Sparql01

  1. #1 by gowestmarketing.com on 11/03/2014 - 14:00

    When I initially left a comment I appear to have clicked the
    -Notify me when new comments are added- checkbox and now every time a comment is added I get 4 emails with the same comment.
    There has to be a way you are able to remove me from that service?
    Kudos!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: