It's all about the answers!

Ask a question

Custom URI's usage in SPARQL


David Reilly (69742) | asked Aug 08 '18, 10:41 a.m.

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

One answer



permanent link
Petru Acsinte (1311) | answered Aug 08 '18, 7:02 p.m.
JAZZ DEVELOPER

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.


Comments
David Reilly commented Aug 13 '18, 1:41 p.m.

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


Your answer


Register or 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.