Skip to content

Commit

Permalink
Update shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
laurianvm committed Dec 12, 2024
1 parent 23d2247 commit abf6e3e
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 223 deletions.
223 changes: 0 additions & 223 deletions ontology-shapes.ttl

This file was deleted.

47 changes: 47 additions & 0 deletions shapes/Feature-shape.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix mr: <http://marineregions.org/ns/ontology#> .
@prefix mrt: <http://marineregions.org/ns/placetypes#> .
@prefix dc: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix gsp: <http://www.opengis.net/ont/geosparql#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix hydra: <http://www.w3.org/ns/hydra/core#> .

<#FeatureShape>
a sh:NodeShape ;
sh:targetClass mr:MRGeoObject ;

sh:property [
sh:path mr:mrgid ;
sh:datatype xsd:nonNegativeInteger ;
sh:severity sh:Info ;
sh:message "A Feature may have an MRGID (mr:mrgid) as a non-negative integer." ;
] ;
sh:property [
sh:path mr:hasGeometry ;
sh:nodeKind sh:IRI ;
sh:class <http://www.opengis.net/ont/sf#Geometry> ;
sh:severity sh:Info ;
sh:message "A Feature may have a Geometry (<http://www.opengis.net/ont/sf#Geometry>)." ;
] ;
sh:property [
sh:path mr:inContextOf ;
sh:nodeKind sh:IRI ; #**
sh:severity sh:Info ;
sh:message "A Feature may have a context (skos:scopeNote)." ;
] ;
sh:property [
sh:path mr:isRelatedTo ;
sh:nodeKind sh:IRI ;
sh:class mr:Feature ;
sh:severity sh:Info ;
sh:message "A Feature may refer to another semantically related Feature (mr:isRelatedTo), which must be of type mr:Feature." ;
] ;
.

# **confusion:
# mr:inContextOf defined as ObjectProperty, is subclass of skos:conceptNote which is also defined as ObjectProperty with rdfs:Resource as range;
# this means the value of the property can be a resource, which might include literals or other resources like documents
# so, specifying sh:nodeKind as sh:IRI seems both incomplete & wrong...
117 changes: 117 additions & 0 deletions shapes/MRGeoObject-shape.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix mr: <http://marineregions.org/ns/ontology#> .
@prefix mrt: <http://marineregions.org/ns/placetypes#> .
@prefix dc: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix gsp: <http://www.opengis.net/ont/geosparql#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix hydra: <http://www.w3.org/ns/hydra/core#> .


<#MRGeoObjectShape>
a sh:NodeShape ;
sh:targetClass mr:MRGeoObject ;

sh:property [
sh:path mr:mrgid ;
sh:nodeKind sh:IRI ;
sh:cardinality 1 ;
sh:severity sh:Violation ;
sh:message "A geo-object must have at exactly one MRGID (mr:mrgid)." ;
] ;

sh:property [
sh:path skos:prefLabel ;
sh:datatype xsd:string ;
sh:minCount 1 ;
sh:severity sh:Info ; # https://www.w3.org/TR/shacl/#results-severity
sh:message "A geo-object must have at least one preferred label (skos:prefLabel)." ;
] ;

sh:property [
sh:path rdf:type ;
sh:hasValue mrt:PlaceType ;
] ;

sh:property [
sh:path rdfs:isDefinedBy ;
sh:hasValue <http://marineregions.org> ;
] .

sh:property [
sh:path mr:hasGeometry ;
sh:nodeKind sh:IRI ;
sh:class <http://www.opengis.net/ont/sf#Geometry> ;
sh:message "A geo-object may reference a geometry using mr:hasGeometry." ;
] ;

sh:property [
sh:path mr:inContextOf ;
sh:nodeKind sh:IRI ; #see Feature-shape.ttl for confusion issue..
sh:severity sh:Info ;
sh:message "A Feature may have a context (skos:scopeNote)." ;
] ;

sh:property [
sh:path mr:isRelatedTo, mr:isPartOf, mr:contains, mr:isAdministrativePartOf, mr:hasAdministrativePart, mr:isPartlyPartOf, mr:partlyContains, mr:flowsInto, mr:hasTributary, mr:risesIn, mr:containsSourceOf, mr:flowsThrough, mr:containsWatercourse, mr:isReplacedBy, mr:replaces, mr:isInfluencedBy, mr:influences, mr:isAdjacentTo, mr:isPreferredAlternativeOf, mr:hasPreferredAlternative ;
sh:nodeKind sh:IRI ;
sh:severity sh:Info ;
sh:message "A geo-object may reference one or more related entities using mr:isRelatedTo or one of its subclasses." ;
] ;

sh:property [
sh:path prov:hadPrimarySource ;
sh:nodeKind sh:IRI ;
sh:minCount 1 ;
sh:message "A geo-object must have a primary source defined with prov:hadPrimarySource." ;
] ;

sh:property [
sh:path dc:modified ;
sh:datatype xsd:dateTime ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:severity sh:Violation ;
sh:message "A geo-object must have a single modification timestamp (dc:modified)." ;
] ;

sh:property [
sh:path skos:altLabel ;
sh:datatype xsd:string ;
sh:minCount 0 ;
sh:severity sh:Info ;
sh:message "A geo-object may have alternate labels (skos:altLabel)." ;
] ;

#to check/add
sh:property [
sh:path dcat:centroid ;
sh:datatype gsp:wktLiteral ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:message "A geo-object must have a centroid defined as a WKT literal (dcat:centroid)." ;
] ;

sh:property [
sh:path dcat:bbox ;
sh:datatype gsp:wktLiteral ;
sh:minCount 0 ;
sh:maxCount 1 ;
sh:message "A geo-object may have a bounding box defined as a WKT literal (dcat:bbox)." ;
] ;


sh:property [
sh:path hydra:next ;
sh:nodeKind sh:IRI ;
sh:minCount 0 ;
sh:maxCount 1 ;
sh:message "A geo-object may include a hydra:next link for pagination." ;
] .





0 comments on commit abf6e3e

Please sign in to comment.