Skip to content

Commit

Permalink
added shapechange libraries; minor updates in README, run-workflow.sh…
Browse files Browse the repository at this point in the history
…, run.sh
  • Loading branch information
Nataliya Keberle committed Feb 10, 2025
1 parent 8ca5a47 commit 972a1be
Show file tree
Hide file tree
Showing 386 changed files with 129,869 additions and 36 deletions.
1 change: 1 addition & 0 deletions citygml-owl/CityRDF/common.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@prefix common: <https://www.opengis.net/ont/citygml/common/> .
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

<https://www.opengis.net/ont/citygml/common> a owl:Ontology ;
rdfs:label "Common"@en ;
Expand Down
2 changes: 1 addition & 1 deletion citygml-owl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ common:boundary a owl:ObjectProperty ;
transportation:TrafficArea,
transportation:AuxiliaryTrafficArea)].
```
Enforcing strict semantics is implemented as optional step 4 of the workflow. Its results are stored in the folder `/CItyRDF-strict`
Enforcing strict semantics is implemented as optional step 4 of the workflow. Its results are stored in the folder `/CityRDF-strict`
Such strict semantics makes OWL reasoning applicable, although restricts the extension of possible domains and ranges of properties in applications.


Expand Down
24 changes: 0 additions & 24 deletions citygml-owl/additional-triples/citymodelmember.ttl

This file was deleted.

1 change: 1 addition & 0 deletions citygml-owl/additional-triples/common.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@prefix common: <https://www.opengis.net/ont/citygml/common/> .
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

<https://www.opengis.net/ont/citygml/common> a owl:Ontology ;
rdfs:label "Common"@en ;
Expand Down
15 changes: 15 additions & 0 deletions citygml-owl/scripts/converter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import rdflib
from rdflib import Graph
import fire

def refactor(infile=None, outfile=None):
g = rdflib.Graph()
g.parse(infile, format='ttl')

g.serialize(destination=outfile, format='xml')

# print('Refactored RDF file saved to', outfile)

if __name__ == '__main__':
fire.Fire(refactor)

26 changes: 26 additions & 0 deletions citygml-owl/scripts/converter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# #!/bin/sh

mkdir -p ../rdfxml

python converter.py ../CityRDF-strict/appearance.ttl ../rdfxml/appearance.rdf
python converter.py ../CityRDF-strict/bridge.ttl ../rdfxml/bridge.rdf
python converter.py ../CityRDF-strict/building.ttl ../rdfxml/building.rdf
python converter.py ../CityRDF-strict/cityfurniture.ttl ../rdfxml/cityfurniture.rdf
python converter.py ../CityRDF-strict/cityobjectgroup.ttl ../rdfxml/cityobjectgroup.rdf
python converter.py ../CityRDF-strict/construction.ttl ../rdfxml/construction.rdf
python converter.py ../CityRDF-strict/core.ttl ../rdfxml/core.rdf
python converter.py ../CityRDF-strict/document.ttl ../rdfxml/document.rdf
python converter.py ../CityRDF-strict/dynamizer.ttl ../rdfxml/dynamizer.rdf
python converter.py ../CityRDF-strict/generics.ttl ../rdfxml/generics.rdf
python converter.py ../CityRDF-strict/landuse.ttl ../rdfxml/landuse.rdf
python converter.py ../CityRDF-strict/pointcloud.ttl ../rdfxml/pointcloud.rdf
python converter.py ../CityRDF-strict/relief.ttl ../rdfxml/relief.rdf
python converter.py ../CityRDF-strict/transportation.ttl ../rdfxml/transportation.rdf
python converter.py ../CityRDF-strict/tunnel.ttl ../rdfxml/tunnel.rdf
python converter.py ../CityRDF-strict/vegetation.ttl ../rdfxml/vegetation.rdf
python converter.py ../CityRDF-strict/versioning.ttl ../rdfxml/versioning.rdf
python converter.py ../CityRDF-strict/waterbody.ttl ../rdfxml/waterbody.rdf
python converter.py ../CityRDF-strict/workspace.ttl ../rdfxml/workspace.rdf
python converter.py ../CityRDF-strict/common.ttl ../rdfxml/common.rdf

cat ../rdfxml/*.rdf > rdfxml.rdf
4 changes: 1 addition & 3 deletions citygml-owl/scripts/run-workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
# https://raw.githubusercontent.com/VCityTeam/UD-Graph/master/Transformations/test-data/UML/CityGML_3.0-workspaces-documents_shapechange-export.xml

echo '=== stage 1 ==='
java -jar ~/prog/ShapeChange/target/ShapeChange-3.1.1-SNAPSHOT.jar -Dfile.encoding=UTF-8 -c CityGML3.0_to_OWL_ontotext_config.xml \
-x '$input$' './CityGML_3.0-workspaces-documents_shapechange-export.xml' \
-x '$output$' '../stage-1'
./run.sh

echo '=== stage 2 ==='
./patch-ontologies.sh
Expand Down
12 changes: 4 additions & 8 deletions citygml-owl/scripts/run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
java -jar ~/prog/ShapeChange/target/ShapeChange-3.1.1-SNAPSHOT.jar -Dfile.encoding=UTF-8 -c CityGML3.0_to_OWL_ontotext_config.xml \
java -jar shapechange/ShapeChange-3.1.1-SNAPSHOT.jar -Dfile.encoding=UTF-8 -c CityGML3.0_to_OWL_ontotext_config.xml \
-x '$input$' './CityGML_3.0-workspaces-documents_shapechange-export.xml' \
-x '$output$' '../stage-1'

#java -jar ~/prog/ShapeChange/target/ShapeChange-3.1.1-SNAPSHOT.jar -Dfile.encoding=UTF-8 -c CityGML3.0_to_OWL_ontotextBuilding_config.xml \
# -x '$input$' './CityGML_3.0_Building_UML1.3_XMI1.0_NoADEs.xml' \
# -x '$output$' './stage-1'

#java -jar ~/prog/ShapeChange/target/ShapeChange-3.1.1-SNAPSHOT.jar -Dfile.encoding=UTF-8 -c CityGML3.0_to_OWL_ontotextBuilding_config.xml \
# -x '$input$' './CityGML_3.0_Building_UML1.3_XMI1.0_NoADEs.xml' \
# -x '$output$' './stage-1'
#java -jar ~/prog/ShapeChange/target/ShapeChange-3.1.1-SNAPSHOT.jar -Dfile.encoding=UTF-8 -c CityGML3.0_to_OWL_ontotext_config.xml \
# -x '$input$' './CityGML_3.0-workspaces-documents_shapechange-export.xml' \
# -x '$output$' '../stage-1'

Binary file not shown.
Loading

0 comments on commit 972a1be

Please sign in to comment.