diff --git a/citygml-owl/update-triples.sh b/citygml-owl/update-triples.sh index ad81334..d4cabd1 100755 --- a/citygml-owl/update-triples.sh +++ b/citygml-owl/update-triples.sh @@ -130,8 +130,7 @@ where { rdfs:label ?label; skos:definition ?def . filter (strafter(str(?s),"#") in ("class", "usage", "function", "value", "status", "mimeType", "occupancy", "elevation","lowReference","highReference")) bind(IRI(concat("https://www.opengis.net/ont/citygml/common#",strafter(str(?s),"#"))) as ?new) - } - }' + }}' python update_graph.py $file $file \ 'PREFIX owl: @@ -344,8 +343,7 @@ PREFIX rdfs: PREFIX schema: PREFIX skos: insert { -?classIndependentPropNameNew a owl:ObjectProperty ; - rdfs:label ?classIndependentPropName ; +?classIndependentPropNameNew rdfs:label ?classIndependentPropName ; schema:domainIncludes ?domainToInclude ; schema:rangeIncludes ?rangeToInclude ; skos:definition ?def. @@ -356,7 +354,7 @@ insert { ?def where { ?s a owl:ObjectProperty . - optional{bind(strafter(str(?s),"#") as ?classIndependentPropName).} + optional{bind(strafter(strafter(str(?old),"#"),".") as ?classIndependentPropName).} ?s rdfs:label ?classIndependentPropName . ?s rdfs:domain ?domainToInclude . ?s rdfs:range ?rangeToInclude . @@ -366,34 +364,6 @@ where { as ?classIndependentPropNameNew) }}' -python update_graph.py $file $file \ - 'PREFIX owl: -PREFIX rdfs: -PREFIX schema: -PREFIX skos: -insert { -?classIndependentPropNameNew a owl:DatatypeProperty ; - rdfs:label ?classIndependentPropName ; - schema:domainIncludes ?domainToInclude ; - schema:rangeIncludes ?rangeToInclude ; - skos:definition ?def. -} where { select - ?classIndependentPropNameNew - ?rangeToInclude - ?domainToInclude - ?def -where { - ?s a owl:DatatypeProperty . - optional{bind(strafter(str(?s),"#") as ?classIndependentPropName).} - ?s rdfs:label ?classIndependentPropName . - ?s rdfs:domain ?domainToInclude . - ?s rdfs:range ?rangeToInclude . - ?s skos:definition ?def . - filter (str(?classIndependentPropName) in ("name","description")) - bind(IRI(concat("https://www.opengis.net/ont/citygml/common#",str(?classIndependentPropName))) - as ?classIndependentPropNameNew) -}}' - ### 7 removes old definitions of (local) properties for those reused >1 per CityGML family echo 'removes old definitions of properties reused more than once per CityGML family' @@ -411,51 +381,11 @@ delete { where { select ?s ?classIndependentPropName ?domainToInclude ?rangeToInclude ?def where { ?s a owl:ObjectProperty . - optional{bind(strafter(str(?s),"#") as ?classIndependentPropName).} - optional{bind(strbefore(strafter(str(?s),"#"),".") as ?classThePropDepends).} - ?s rdfs:label ?classIndependentPropName . - ?s rdfs:domain ?domainToInclude . - ?s rdfs:range ?rangeToInclude . - filter (str(?classIndependentPropName) in ("boundary","address","intersection","section","genericAttribute","pointCloud","buildingFurniture","buildingInstallation","appearance","relatedTo","lod0MultiCurve","lod0MultiSurface","lod2MultiSurface","lod3MultiSurface","versionMember","referencePoint","tunnelFurniture","tunnelInstallation","groupMember","buildingConstructiveElement","buildingRoom","bridgeFurniture","bridgeInstallation","textureParameterization")) - filter (strbefore(str(?s),"#") in ("https://www.opengis.net/ont/citygml/appearance", -"https://www.opengis.net/ont/citygml/bridge", -"https://www.opengis.net/ont/citygml/building", -"https://www.opengis.net/ont/citygml/cityfurniture", -"https://www.opengis.net/ont/citygml/cityobjectgroup", -"https://www.opengis.net/ont/citygml/construction", -"https://www.opengis.net/ont/citygml/core", -"https://www.opengis.net/ont/citygml/document", -"https://www.opengis.net/ont/citygml/dynamizer", -"https://www.opengis.net/ont/citygml/generics", -"https://www.opengis.net/ont/citygml/landuse", -"https://www.opengis.net/ont/citygml/pointcloud", -"https://www.opengis.net/ont/citygml/relief", -"https://www.opengis.net/ont/citygml/transportation", -"https://www.opengis.net/ont/citygml/tunnel", -"https://www.opengis.net/ont/citygml/vegetation", -"https://www.opengis.net/ont/citygml/versioning", -"https://www.opengis.net/ont/citygml/waterbody", -"https://www.opengis.net/ont/citygml/workspace")) - }}' - -python update_graph.py $file $file \ - 'PREFIX owl: -PREFIX rdfs: -PREFIX skos: -delete { - ?s a owl:DatatypeProperty . - ?s rdfs:label ?classIndependentPropName . - ?s rdfs:domain ?domainToInclude . - ?s rdfs:range ?rangeToInclude . - ?s skos:definition ?def . - } -where { select ?s ?classIndependentPropName ?domainToInclude ?rangeToInclude ?def - where { - ?s a owl:DatatypeProperty . optional{bind(strafter(str(?s),"#") as ?classIndependentPropName).} ?s rdfs:label ?classIndependentPropName . ?s rdfs:domain ?domainToInclude . ?s rdfs:range ?rangeToInclude . + ?s skos:definition ?def . filter (str(?classIndependentPropName) in ("boundary","address","intersection","section","genericAttribute","pointCloud","buildingFurniture","buildingInstallation","appearance","relatedTo","lod0MultiCurve","lod0MultiSurface","lod2MultiSurface","lod3MultiSurface","versionMember","referencePoint","tunnelFurniture","tunnelInstallation","groupMember","buildingConstructiveElement","buildingRoom","bridgeFurniture","bridgeInstallation","textureParameterization")) filter (strbefore(str(?s),"#") in ("https://www.opengis.net/ont/citygml/appearance", "https://www.opengis.net/ont/citygml/bridge", @@ -493,10 +423,11 @@ insert { where { select ?s ?new where { - ?s owl:onProperty ?old ; - filter (strafter(str(?old),"#") in ("boundary","address","intersection","section","genericAttribute","pointCloud","buildingFurniture","buildingInstallation","appearance","relatedTo","lod0MultiCurve","lod0MultiSurface","lod2MultiSurface","lod3MultiSurface","versionMember","referencePoint","tunnelFurniture","tunnelInstallation","groupMember","buildingConstructiveElement","buildingRoom","bridgeFurniture","bridgeInstallation","textureParameterization")) - bind(IRI(concat("https://www.opengis.net/ont/citygml/common#",strafter(str(?old),"#"))) as ?new) - }}' + ?s owl:onProperty ?old . + filter (strafter(strafter(str(?old),"#"),".") in ("boundary","address","intersection","section","genericAttribute","pointCloud","buildingFurniture","buildingInstallation","appearance","relatedTo","lod0MultiCurve","lod0MultiSurface","lod2MultiSurface","lod3MultiSurface","versionMember","referencePoint","tunnelFurniture","tunnelInstallation","groupMember","buildingConstructiveElement","buildingRoom","bridgeFurniture","bridgeInstallation","textureParameterization")) + bind(IRI(concat("https://www.opengis.net/ont/citygml/common#",strafter(strafter(str(?old),"#"),"."))) as ?new) + }} +' ### #9 deletes all (local) props mentions in axioms for those properties reused >1 echo 'deletes presence of global properties in axioms' @@ -508,8 +439,10 @@ delete { ?s owl:onProperty ?old . } where { + select ?s ?old + where { ?s owl:onProperty ?old. - filter (strafter(str(?old), "#") in ("boundary","address","intersection","section","genericAttribute","pointCloud","buildingFurniture","buildingInstallation","appearance","relatedTo","lod0MultiCurve","lod0MultiSurface","lod2MultiSurface","lod3MultiSurface","versionMember","referencePoint","tunnelFurniture","tunnelInstallation","groupMember","buildingConstructiveElement","buildingRoom","bridgeFurniture","bridgeInstallation","textureParameterization")) + filter (strafter(strafter(str(?old),"#"),".") in ("boundary","address","intersection","section","genericAttribute","pointCloud","buildingFurniture","buildingInstallation","appearance","relatedTo","lod0MultiCurve","lod0MultiSurface","lod2MultiSurface","lod3MultiSurface","versionMember","referencePoint","tunnelFurniture","tunnelInstallation","groupMember","buildingConstructiveElement","buildingRoom","bridgeFurniture","bridgeInstallation","textureParameterization")) filter (strbefore(str(?old),"#") in ("https://www.opengis.net/ont/citygml/appearance", "https://www.opengis.net/ont/citygml/bridge", "https://www.opengis.net/ont/citygml/building", @@ -529,7 +462,7 @@ where { "https://www.opengis.net/ont/citygml/versioning", "https://www.opengis.net/ont/citygml/waterbody", "https://www.opengis.net/ont/citygml/workspace")) -}' + }}' done