@prefix core: <https://dataset-dl.liris.cnrs.fr/rdf-owl-urban-data-ontologies/Ontologies/CityGML/3.0/core#> .
@prefix iso19150-2: <http://def.isotc211.org/iso19150/-2/2012/base#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix vers: <https://dataset-dl.liris.cnrs.fr/rdf-owl-urban-data-ontologies/Ontologies/CityGML/3.0/versioning#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<https://dataset-dl.liris.cnrs.fr/rdf-owl-urban-data-ontologies/Ontologies/CityGML/3.0/versioning> a owl:Ontology ;
    rdfs:label "Versioning"@en ;
    owl:imports <http://def.isotc211.org/iso19150/-2/2012/base>,
        <https://dataset-dl.liris.cnrs.fr/rdf-owl-urban-data-ontologies/Ontologies/CityGML/3.0/core.ttl> ;
    skos:definition "The Versioning module supports representation of multiple versions of CityGML features within a single CityGML model. In addition, also the version transitions and transactions that lead to the different versions can be represented."@en .

vers:Version.adeOfVersion a owl:ObjectProperty ;
    rdfs:label "adeOfVersion"@en ;
    rdfs:domain vers:Version ;
    rdfs:range vers:ADEOfVersion ;
    skos:definition "Augments the Version with properties defined in an ADE."@en .

vers:Version.tag a owl:DatatypeProperty ;
    rdfs:label "tag"@en ;
    rdfs:domain vers:Version ;
    rdfs:range xsd:string ;
    skos:definition "Allows for adding keywords to the city model version."@en .

vers:Version.versionMember a owl:ObjectProperty ;
    rdfs:label "versionMember"@en ;
    rdfs:domain vers:Version ;
    rdfs:range core:AbstractFeatureWithLifespan ;
    skos:definition "Relates to all city objects that are part of the city model version."@en .

vers:VersionTransition.adeOfVersionTransition a owl:ObjectProperty ;
    rdfs:label "adeOfVersionTransition"@en ;
    rdfs:domain vers:VersionTransition ;
    rdfs:range vers:ADEOfVersionTransition ;
    skos:definition "Augments the VersionTransition with properties defined in an ADE."@en .

vers:VersionTransition.transaction a owl:ObjectProperty ;
    rdfs:label "transaction"@en ;
    rdfs:domain vers:VersionTransition ;
    rdfs:range vers:Transaction ;
    skos:definition "Relates to all transactions that have been applied as part of the VersionTransition."@en .

vers:ADEOfVersion a owl:Class ;
    rdfs:label "ADEOfVersion"@en ;
    iso19150-2:isAbstract true ;
    skos:definition "ADEOfVersion acts as a hook to define properties within an ADE that are to be added to a Version."@en .

vers:ADEOfVersionTransition a owl:Class ;
    rdfs:label "ADEOfVersionTransition"@en ;
    iso19150-2:isAbstract true ;
    skos:definition "ADEOfVersionTransition acts as a hook to define properties within an ADE that are to be added to a VersionTransition."@en .

vers:Transaction.newFeature a owl:ObjectProperty ;
    rdfs:label "newFeature"@en ;
    rdfs:domain vers:Transaction ;
    rdfs:range core:AbstractFeatureWithLifespan ;
    skos:definition "Relates to the version of the city object subsequent to the Transaction."@en .

vers:Transaction.oldFeature a owl:ObjectProperty ;
    rdfs:label "oldFeature"@en ;
    rdfs:domain vers:Transaction ;
    rdfs:range core:AbstractFeatureWithLifespan ;
    skos:definition "Relates to the version of the city object prior to the Transaction."@en .

vers:Transaction.type a owl:DatatypeProperty ;
    rdfs:label "type"@en ;
    rdfs:domain vers:Transaction ;
    rdfs:range vers:TransactionTypeValue ;
    skos:definition "Indicates the specific type of the Transaction."@en .

vers:VersionTransition.clonePredecessor a owl:DatatypeProperty ;
    rdfs:label "clonePredecessor"@en ;
    rdfs:domain vers:VersionTransition ;
    rdfs:range xsd:boolean ;
    skos:definition "Indicates whether the set of city object instances belonging to the successor version of the city model is either explicitly enumerated within the successor version object (attribute clonePredecessor=false),  or has to be derived from the modifications of the city model provided as a list of transactions on the city object versions contained in the predecessor version (attribute clonePredecessor=true)."@en .

vers:VersionTransition.from a owl:ObjectProperty ;
    rdfs:label "from"@en ;
    rdfs:domain vers:VersionTransition ;
    rdfs:range vers:Version ;
    skos:definition "Relates to the predecessor version of the VersionTransition."@en .

vers:VersionTransition.reason a owl:DatatypeProperty ;
    rdfs:label "reason"@en ;
    rdfs:domain vers:VersionTransition ;
    rdfs:range xsd:string ;
    skos:definition "Specifies why the VersionTransition has been carried out."@en .

vers:VersionTransition.to a owl:ObjectProperty ;
    rdfs:label "to"@en ;
    rdfs:domain vers:VersionTransition ;
    rdfs:range vers:Version ;
    skos:definition "Relates to the successor version of the VersionTransition."@en .

vers:VersionTransition.type
    # a owl:DatatypeProperty ;
    a owl:ObjectProperty ;
    rdfs:label "type"@en ;
    rdfs:domain vers:VersionTransition ;
    rdfs:range vers:TransitionTypeValue ;
    skos:definition "Indicates the specific type of the VersionTransition."@en .

vers:TransactionTypeValue
    a                owl:Class ;
    rdfs:subClassOf  skos:Concept ;
    # a rdfs:Datatype ;
    # owl:equivalentClass [ a rdfs:Datatype ;
    #         owl:oneOf ( "insert" "delete" "replace" ) ] ;
    # skos:definition "TransactionTypeValue enumerates the three possible types of transactions: insert, delete, or replace."@en .
    rdfs:label "TransactionTypeValue"@en ;
    skos:definition  "TransactionTypeValue represents the type of transaction expressed by an skos:Concept."@en .

vers:TransitionTypeValue a rdfs:Datatype ;
    rdfs:label "TransitionTypeValue"@en ;
    owl:equivalentClass [ a rdfs:Datatype ;
            owl:oneOf ( "planned" "realized" "historicalSuccession" "fork" "merge" ) ] ;
    skos:definition "TransitionTypeValue enumerates the different kinds of version transitions. “planned” and “fork” should be used in cases when from one city model version multiple successor versions are being created. “realized” and “merge” should be used when different city model versions are converging into a common successor version."@en .

vers:Transaction a owl:Class ;
    rdfs:label "Transaction"@en ;
    rdfs:subClassOf [ a owl:Restriction ;
            owl:allValuesFrom core:AbstractFeatureWithLifespan ;
            owl:onProperty vers:Transaction.newFeature ],
        [ a owl:Restriction ;
            owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
            owl:onClass core:AbstractFeatureWithLifespan ;
            owl:onProperty vers:Transaction.newFeature ],
        [ a owl:Restriction ;
            owl:allValuesFrom core:AbstractFeatureWithLifespan ;
            owl:onProperty vers:Transaction.oldFeature ],
        [ a owl:Restriction ;
            owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
            owl:onClass core:AbstractFeatureWithLifespan ;
            owl:onProperty vers:Transaction.oldFeature ],
        [ a owl:Restriction ;
            owl:allValuesFrom vers:TransactionTypeValue ;
            owl:onProperty vers:Transaction.type ],
        [ a owl:Restriction ;
            owl:onDataRange vers:TransactionTypeValue ;
            owl:onProperty vers:Transaction.type ;
            owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ] ;
    skos:definition "Transaction represents a modification of the city model by the creation, termination, or replacement of a specific city object. While the creation of a city object also marks its first object version, the termination marks the end of existence of a real world object and, hence, also terminates the final version of a city object. The replacement of a city object means that a specific version of it is replaced by a new version."@en .

vers:VersionTransition a owl:Class ;
    rdfs:label "VersionTransition"@en ;
    rdfs:subClassOf [ a owl:Restriction ;
            owl:allValuesFrom vers:Version ;
            owl:onProperty vers:VersionTransition.to ],
        [ a owl:Restriction ;
            owl:allValuesFrom xsd:boolean ;
            owl:onProperty vers:VersionTransition.clonePredecessor ],
        [ a owl:Restriction ;
            owl:allValuesFrom vers:TransitionTypeValue ;
            owl:onProperty vers:VersionTransition.type ],
        [ a owl:Restriction ;
            owl:onDataRange xsd:boolean ;
            owl:onProperty vers:VersionTransition.clonePredecessor ;
            owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ],
        [ a owl:Restriction ;
            owl:allValuesFrom vers:ADEOfVersionTransition ;
            owl:onProperty vers:VersionTransition.adeOfVersionTransition ],
        [ a owl:Restriction ;
            owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
            owl:onClass vers:Version ;
            owl:onProperty vers:VersionTransition.to ],
        [ a owl:Restriction ;
            owl:allValuesFrom xsd:string ;
            owl:onProperty vers:VersionTransition.reason ],
        [ a owl:Restriction ;
            owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
            # owl:onDataRange vers:TransitionTypeValue ;
            owl:onClass vers:TransitionTypeValue ;
            owl:onProperty vers:VersionTransition.type ],
        [ a owl:Restriction ;
            owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
            owl:onClass vers:Version ;
            owl:onProperty vers:VersionTransition.from ],
        [ a owl:Restriction ;
            owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
            owl:onDataRange xsd:string ;
            owl:onProperty vers:VersionTransition.reason ],
        [ a owl:Restriction ;
            owl:allValuesFrom vers:Version ;
            owl:onProperty vers:VersionTransition.from ],
        [ a owl:Restriction ;
            owl:allValuesFrom vers:Transaction ;
            owl:onProperty vers:VersionTransition.transaction ],
        core:AbstractVersionTransition ;
    skos:definition "VersionTransition describes the change of the state of a city model from one version to another. Version transitions can have names, a description and can be further qualified by a type and a reason."@en .

vers:Version a owl:Class ;
    rdfs:label "Version"@en ;
    rdfs:subClassOf [ a owl:Restriction ;
            owl:allValuesFrom vers:ADEOfVersion ;
            owl:onProperty vers:Version.adeOfVersion ],
        [ a owl:Restriction ;
            owl:allValuesFrom core:AbstractFeatureWithLifespan ;
            owl:onProperty vers:Version.versionMember ],
        [ a owl:Restriction ;
            owl:allValuesFrom xsd:string ;
            owl:onProperty vers:Version.tag ],
        core:AbstractVersion ;
    skos:definition "Version represents a defined state of a city model consisting of the dedicated versions of all city object instances that belong to the respective city model version. Versions can have names, a description and can be labeled with an arbitrary number of user defined tags."@en .

