Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Custom URI's usage in SPARQL

Hi all, 

I've defined URI's in my project area for specific artifact types and attributes and I was wondering which approach would work best for creating a custom SPARQL query.  
PREFIX custom: <http://customuri.com/dng#>

SELECT DISTINCT
  ?Custom_identifier
  ?Custom_title
  ?Custom
WHERE{
  ?Custom_uri oslc:instanceShape ?Custom_uri_instanceShape.
  ?Custom_uri owl:sameAs custom:Type. 
....
    }


Is this the right approach? Ideally this would avoid directly specifying the type with a "merge:mergeShape" reference. 

Thanks to anyone who provides me guidance - online resources or sparql guides are appreciated as well. 

David

0 votes



One answer

Permanent link

Depending on how you define RDF URIs for the enumeration members, this approach might not work for you.
For example:
Data type "Level" http://jazz.net/rm/types/level
has members "Critical" (http://jazz.net/rm/types/level#critical) and "Safe" (http://jazz.net/rm/types/level#safe)
This condition won't work properly:
PREFIX custom: <http://jazz.net/rm/types/>
....   ?member owl:sameAs custom:level#safe .

One other thing to keep in mind: RDF URI is optional. Your query will miss those type versions that do not specify it.

0 votes

Comments

Just so I understand correctly, the working version of your snippet above should look like this?


Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938
× 360
× 25

Question asked: Aug 08 '18, 10:41 a.m.

Question was seen: 2,395 times

Last updated: Aug 13 '18, 1:41 p.m.

Confirmation Cancel Confirm