Skip to content

Commit

Permalink
offer shacl first pass
Browse files Browse the repository at this point in the history
  • Loading branch information
saumier committed Dec 6, 2023
1 parent ba5b95e commit 9758802
Show file tree
Hide file tree
Showing 18 changed files with 343 additions and 110 deletions.
17 changes: 0 additions & 17 deletions Gemfile

This file was deleted.

141 changes: 114 additions & 27 deletions frame/lavitrine_event_frame.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"description": {
"@container": "@language"
},
"disambiguatingDescription" :{
"disambiguatingDescription": {
"@container": "@language"
},
"definition" :{
"definition": {
"@id": "skos:definition",
"@container": "@language"
},
Expand Down Expand Up @@ -87,7 +87,7 @@
},
"EventScheduled": {
"@id": "EventScheduled",
"@type": "EventStatusType"
"@type": "EventStatusType"
},
"representation": {
"@id": "subEvent",
Expand All @@ -111,21 +111,42 @@
"@explicit": true,
"@embed": "@always",
"additionalType": {
"@type":"skos:Concept",
"@type": "skos:Concept",
"@explicit": true,
"@omitDefault": true,
"prefLabel":{},
"skos:exactMatch": {},
"skos:broader":{}
"prefLabel": {},
"skos:exactMatch": {
"@type": "skos:Concept",
"@explicit": true,
"@omitDefault": true,
"prefLabel": {}
},
"skos:broader": {
"@type": "skos:Concept",
"@explicit": true,
"@omitDefault": true,
"prefLabel": {},
"skos:exactMatch": {
"@embed": "@never",
"@omitDefault": true
},
"skos:broader": {
"@embed": "@never",
"@omitDefault": true
}
}
},
"description": {},
"image": {},
"location": {
"@type":["Place","VirtualLocation"],
"@type": [
"Place",
"VirtualLocation"
],
"@explicit": true,
"@omitDefault": true,
"name": {},
"sameAs":{
"sameAs": {
"@embed": "@never"
},
"address": {
Expand All @@ -137,10 +158,10 @@
"postalCode": {},
"streetAddress": {}
},
"latitude":{},
"longitude":{},
"latitude": {},
"longitude": {},
"containedInPlace": {
"@type":"Place",
"@type": "Place",
"@explicit": true,
"name": {},
"address": {
Expand All @@ -156,24 +177,38 @@
},
"name": {},
"performer": {
"@type": ["Person","Organization"],
"@type": [
"Person",
"Organization"
],
"@omitDefault": true,
"@explicit": true,
"@embed": "@always",
"name": {},
"sameAs": { "@embed": "@never", "@omitDefault": true},
"url":{ "@omitDefault": true},
"facebook":{ "@omitDefault": true}
"sameAs": {
"@embed": "@never",
"@omitDefault": true
},
"url": {
"@omitDefault": true
}
},
"organizer": {
"@type": ["Person","Organization"],
"@type": [
"Person",
"Organization"
],
"@omitDefault": true,
"@explicit": true,
"@embed": "@always",
"name": {},
"sameAs": { "@embed": "@never", "@omitDefault": true},
"url":{ "@omitDefault": true},
"facebook":{ "@omitDefault": true}
"sameAs": {
"@embed": "@never",
"@omitDefault": true
},
"url": {
"@omitDefault": true
}
},
"url": {},
"representation": {
Expand All @@ -186,15 +221,67 @@
"eventStatus": {},
"eventAttendanceMode": {},
"offers": {
"@type": ["Offer","AggregateOffer"],
"@type": [
"AggregateOffer",
"Offer"
],
"@explicit": true,
"@embed": "@always",
"@omitDefault": true,
"availability": {"@omitDefault": true},
"price": {"@omitDefault": true},
"priceCurrency": {"@omitDefault": true},
"url": {"@omitDefault": true},
"additionalType": {"@omitDefault": true}
"availability": {
"@omitDefault": true
},
"price": {
"@omitDefault": true
},
"priceCurrency": {
"@omitDefault": true
},
"url": {},
"lowPrice": {
"@omitDefault": true
},
"highPrice": {
"@omitDefault": true
},
"additionalType": {
"@omitDefault": true
},
"name": [{
"@omitDefault": true
}],
"validFrom": {
"@omitDefault": true
},
"validThrough": {
"@omitDefault": true
},
"offers": {
"@type": "Offer",
"@omitDefault": true,
"availability": {
"@omitDefault": true
},
"price": {
"@omitDefault": true
},
"priceCurrency": {
"@omitDefault": true
},
"url": {
"@omitDefault": true
},
"additionalType": {
"@omitDefault": true
},
"name": {},
"validFrom": {
"@omitDefault": true
},
"validThrough": {
"@omitDefault": true
}
}
}
}
}
}
4 changes: 2 additions & 2 deletions readme.sparqlbook
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"kind": 1,
"language": "markdown",
"value": "Tools to trace data pipeline\n=======\n\nThis SPARQL counts top level events that are exported from Artsdata to La Vitrine.",
"value": "SPARQL Notebook\n=======\n\nCount events that are exported from Artsdata to La Vitrine.",
"metadata": {}
},
{
Expand All @@ -14,7 +14,7 @@
{
"kind": 1,
"language": "markdown",
"value": "Tracing missing data\n================\n\nSome steps to trace issues.\n\nLoad Source Webpage data\n-----------------\nStart by looking at the source\n Use this linter http://linter.structured-data.org/ with the event webpage url passed as `&url=`\n\nExample webpage: \n[OSQ - Clemens Schuldt entre en scène](http://linter.structured-data.org/?url=https://grandtheatre.qc.ca/programmation/osq-clemens-schuldt-entre-en-scene/)\n\nThen check the URI in Artsdata with this SPARQL",
"value": "How to trace missing data\n================\n\nTo trace an individual event:\n\n1. Load Source Webpage data\n\n Start by looking at the source webpage for the event.\n \n Use this linter http://linter.structured-data.org/. You can copy/paste the url or pass the url using `&url=. \n \n Here is an example linted webpage from Grand Theatre website for the event: \n [OSQ - Clemens Schuldt entre en scène](http://linter.structured-data.org/?url=https://grandtheatre.qc.ca/programmation/osq-clemens-schuldt-entre-en-scene/)\n\n2. Check the URI in Artsdata with this SPARQL",
"metadata": {}
},
{
Expand Down
50 changes: 32 additions & 18 deletions shacl/lavitrine_event_shacl.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
####################################################
# Lavitrine Events SHACL v1
#
# Main difference with Artsdsata is that single
# Events are EventSeries with single subEvent.
# Main difference with Artsdsata:
# - Single Events are transformed into EventSeries with single subEvent.
####################################################

# EventSeries mapped to Spectacles
ads:EventSeriesNode
sh:targetClass schema:EventSeries ;
sh:property ads:descriptionProp,
Expand All @@ -23,11 +22,12 @@ ads:EventSeriesNode
ads:performerProp,
ads:organizerProp,
ads:urlProp,
ads:subEventProp .
ads:subEventProp ;
.

ads:descriptionProp
sh:path schema:description ;
sh:uniqueLang true ;
# sh:uniqueLang true ;
sh:minCount 1 .

ads:locationProp
Expand All @@ -50,7 +50,8 @@ ads:organizerProp
sh:or (
[ sh:node ads:PersonNode ; ]
[ sh:node ads:OrganizationNode ; ]
) .
) ;
.

ads:subEventProp
sh:path schema:subEvent ;
Expand All @@ -59,13 +60,14 @@ ads:subEventProp


################
# Events mapped to Representations
# Events
################

ads:EventNode
sh:targetClass schema:Event ;
sh:property ads:nameProp,
ads:startDateProp,
ads:endDateProp,
ads:offersProp,
ads:eventStatusProp ,
ads:eventAttendanceModeProp .
Expand All @@ -79,10 +81,23 @@ ads:startDateProp
sh:maxCount 1 ;
sh:minCount 1 .

ads:endDateProp
sh:path schema:endDate ;
sh:or (
[ sh:datatype xsd:dateTime ; ]
[ sh:datatype xsd:date ; ]
) ;
sh:maxCount 1 ;
sh:minCount 0 .

ads:offersProp
sh:path schema:offers ;
sh:node sh:OfferNode ;
sh:minCount 0 .
sh:minCount 1 ;
sh:or (
[ sh:node ads:OfferNode ; ]
[ sh:node ads:AggregateOfferNode ; ]
) ;
.

ads:eventStatusProp
sh:path schema:eventStatus ;
Expand All @@ -100,16 +115,15 @@ ads:eventAttendanceModeProp
schema:OfflineEventAttendanceMode
schema:HybridEventAttendanceMode ) .

# Nested
# See lavitrine_offer_shacl.ttl
ads:OfferNode
sh:targetClass schema:Offer ;
sh:property ads:validFromProp .

ads:validFromProp
sh:path schema:validFrom ;
sh:minCount 0 ;
sh:datatype xsd:dateTime .
sh:targetClass schema:Offer
.

# See lavitrine_offer_shacl.ttl
ads:AggregateOfferNode
sh:targetClass schema:AggregateOffer
.

################
# Place
Expand All @@ -123,7 +137,7 @@ ads:PlaceNode
ads:addressProp,
ads:containedInPlaceProp,
ads:longitudeProp,
ads:latitudeProp;
ads:latitudeProp ;
.

ads:containedInPlaceProp
Expand Down
Loading

0 comments on commit 9758802

Please sign in to comment.