From de0e4614577dbdf3616fbe9eafa810c77833eabf Mon Sep 17 00:00:00 2001 From: Alejandro Villar Date: Fri, 10 Nov 2023 09:56:10 +0100 Subject: [PATCH] Add top concept entailments to ogc_skos_profile_entailments --- scripts/ogc_skos_profile_entailments.ttl | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/scripts/ogc_skos_profile_entailments.ttl b/scripts/ogc_skos_profile_entailments.ttl index b92d3194..16afc62a 100644 --- a/scripts/ogc_skos_profile_entailments.ttl +++ b/scripts/ogc_skos_profile_entailments.ttl @@ -31,8 +31,9 @@ a sh:NodeShape ; sh:rule :topcollection ; sh:rule :inscheme_by_uriroot ; - sh:rule :source_required; - # :rdfslabel> ; + sh:rule :source_required ; + #sh:rule :rdfslabel> ; + sh:rule :topConcepts ; sh:targetClass skos:ConceptScheme ; . @@ -190,6 +191,19 @@ WHERE { . - - - +:topConcepts + a sh:SPARQLRule ; + rdfs:label "Add topConceptOf and hasTopConcept when no broader present" ; + sh:order 99 ; + sh:construct """ + PREFIX skos: + CONSTRUCT { + $this skos:hasTopConcept ?concept . + ?concept skos:topConceptOf $this . + } WHERE { + ?concept skos:inScheme $this . + FILTER NOT EXISTS { ?concept skos:broader ?broader1 } + FILTER NOT EXISTS { ?broader2 skos:narrower ?concept } + } + """ ; +. \ No newline at end of file