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 owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX merge: <http://jazz.net/ns/lqe/merge/>
PREFIX oslc: <http://open-services.net/ns/core#>
PREFIX dng_merged: <http://jazz.net/ns/lqe/merge/gensym/rm/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX custom: <http://customuri.com/dng#>
SELECT DISTINCT?Custom_identifier?Custom_title?CustomWHERE{?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
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
Just so I understand correctly, the working version of your snippet above should look like this?
PREFIX level: <http://jazz.net/rm/types/level#>
?member owl:sameAs level:safe.