Virtual graph mapping and ontologies

A question probably arising from my ignorance:

For the mappings in a virtual graph to follow the correct practice, should I name them according to the SHACL shape or the path property?

Example:
Ontology file in turtle format

http://semantic.com/x-org-my-ontology/MyStation
a http://www.w3.org/ns/shacl#NodeShape ;
a http://www.w3.org/2002/07/owl#Class ;
http://www.w3.org/2000/01/rdf-schema#label "my Station" ;
http://www.w3.org/2000/01/rdf-schema#subClassOf http://semantic.com/x-org-my-ontology/Station ;
http://www.w3.org/2000/01/rdf-schema#comment "lorem ipsum" ;
http://datashapes.org/dash#abstract false ;
http://www.w3.org/ns/shacl#property http://semantic.com/x-org-my-ontology/MyStation-hasLocationID .

http://semantic.com/x-org-my-ontology/MyStation-hasLocationID
a http://www.w3.org/ns/shacl#PropertyShape ;
http://www.w3.org/ns/shacl#path http://semantic.com/x-org-my-ontology/LocationID ;
http://www.w3.org/ns/shacl#name "has location ID" ;
http://www.w3.org/ns/shacl#datatype http://www.w3.org/2001/XMLSchema#string .

Current mapping in SMS2 format
MAPPING urn:someidhere
FROM SQL {
SELECT
LOCATION_ID,
...
FROM my_source_db
} TO {
?station a ont:MyStation ;
ont:LocationID ?LOCATION_ID .
OR
ont:MyStation-hasLocationID ?LOCATION_ID .

} WHERE {
BIND(template("urn:station?=id={LOCATION_ID}") AS ?station)
}

Any insights, best practices or flaming is welcome! Thx!

Hi Oliver,

it should be the path property, in your case ont:LocationID. The IRI http://semantic.com/x-org-my-ontology/MyStation-hasLocationID is an (probably automatically created) identifier within you SHACL shapes to say that the node shape MyStation has an associated property shape for a property with the name has location ID. See also the SHACL spec on property shapes for more details.

Best regards
Lars

1 Like