Skip to content

Instantly share code, notes, and snippets.

@fkleedorfer
Created November 16, 2017 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fkleedorfer/81b32e3235105a4a4743e9fa76ba9332 to your computer and use it in GitHub Desktop.
Save fkleedorfer/81b32e3235105a4a4743e9fa76ba9332 to your computer and use it in GitHub Desktop.
WoN goal-merging and checking
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix s: <http://schema.org/> .
@prefix ex1: <http://example.org/1/> .
@prefix ex2: <http://example.org/2/> .
@prefix voc: <http://example.org/myvocabulary/> .
@prefix taxi: <http://example.org/taxi/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
# data provided by participant "p1" (identified by ex:p1)
ex1:p1-data {
ex1:p1 voc:hasGoal ex1:p1g.
ex1:p1g voc:hasDataGraph ex1:p1g-data;
voc:hasShapesGraph ex1:p1g-shapes.
}
ex1:p1g-data {
ex1:ride1 a taxi:Ride .
ex1:ride1 taxi:hasDriver ex1:p1 . # note: p1 links her own identifier to the structure
ex1:ride1 taxi:hasPickupLocation ex1:pickup1;
}
ex1:p1g-shapes {
ex1:selfShape
a sh:NodeShape ;
sh:targetNode ex1:p1 ;
sh:property [
sh:path [ sh:inversePath taxi:hasDriver ];
sh:class taxi:Ride ;
] .
ex1:TaxiRideShape
a sh:NodeShape ;
sh:targetClass taxi:Ride ;
sh:property [
sh:path taxi:hasPickupLocation ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:class s:GeoCoordinates
] ;
sh:property [
sh:path taxi:hasPickupTime;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:dateTime;
] ;
sh:property [
sh:path taxi:hasClient;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:nodeKind sh:IRI ;
] ;
sh:property [
sh:path taxi:hasDriver;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:value ex1:p1 ; # p1's shape ties her own identifier to the data
] ;
sh:ignoredProperties ( rdf:type ) ;
sh:closed true .
}
# data provided by participant "p2" (identified by ex:p2)
ex2:p2-data {
ex2:p2 voc:hasGoal ex2:p2g.
ex2:p2g voc:hasDataGraph ex2:p2g-data;
voc:hasShapesGraph ex2:p2g-shapes .
voc:hasMergeClass taxi:Ride .
}
ex2:p2g-data {
ex2:myRide a taxi:Ride.
ex2:myRide taxi:hasClient ex2:p2 . # note: p2 links her own identifier to the structure
ex2:myRide taxi:hasPickupLocation ex2:myPickupLocation .
ex2:myPickupLocation a s:GeoCoordinates ;
s:latitude "48.213814" ;
s:longitude "16.340870" .
}
ex2:p2g-shapes {
ex2:selfShape
a sh:NodeShape ;
sh:targetNode ex2:p2 ;
sh:property [
sh:path [ sh:inversePath taxi:hasClient ];
sh:class taxi:Ride ;
] .
ex2:TaxiRideShape
a sh:NodeShape;
sh:targetClass taxi:Ride ;
sh:property [
sh:path taxi:hasPickupTime;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:dateTime;
] ;
sh:property [
sh:path taxi:hasPickupLocation ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:class s:GeoCoordinates
] ;
sh:property [
sh:path taxi:hasClient;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:value ex2:p2 ;
] ;
sh:property [
sh:path taxi:hasDriver;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:nodeKind sh:IRI ;
] ;
sh:ignoredProperties ( rdf:type ) ;
sh:closed true .
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment