KnowledgeCaptureAndDiscovery / OBA

Ontology based APIs
Apache License 2.0
37 stars 11 forks source link

Mapping for Equivalent classes #139

Open DougalW opened 4 years ago

DougalW commented 4 years ago

Hi, just a thought - to map equivalent classes, how about converting these to primitive classes e.g. take the class "System" where "A system is an artifact with component parts where the parts contribute to the goal of the system".

    <owl:Class rdf:about="https://businessontology.com/ontology/System">
        <owl:equivalentClass>
            <owl:Class>
                <owl:intersectionOf rdf:parseType="Collection">
                    <rdf:Description rdf:about="https://businessontology.com/ontology/Artifact"/>
                    <owl:Restriction>
                        <owl:onProperty rdf:resource="https://businessontology.com/ontology/hasPart"/>
                        <owl:someValuesFrom rdf:resource="https://businessontology.com/ontology/Component"/>
                    </owl:Restriction>
                </owl:intersectionOf>
            </owl:Class>
        </owl:equivalentClass>
        <rdfs:subClassOf rdf:resource="https://businessontology.com/ontology/Artifact"/>
    </owl:Class>

When converted to a primitive class becomes:

    <owl:Class rdf:about="https://businessontology.com/ontology/System">
        <rdfs:subClassOf rdf:resource="https://businessontology.com/ontology/Artifact"/>
        <rdfs:subClassOf>
            <owl:Restriction>
                <owl:onProperty rdf:resource="https://businessontology.com/ontology/hasPart"/>
                <owl:someValuesFrom rdf:resource="https://businessontology.com/ontology/Component"/>
            </owl:Restriction>
        </rdfs:subClassOf>
    </owl:Class>

which now conforms to the OBA mapping.

dgarijo commented 4 years ago

This looks like a good idea, but I would have to double check with other cases. Is it a safe assumption to always map it as a subclass? I cannot think of anything that could be wrong right now.

DougalW commented 4 years ago

I think it's safe to map to one or more subclasses - this is the behaviour in Protege if you select Edit / Convert to Primitive Class. The only problem I can see is if there's complex boolean expressions, but in that case I would refactor my ontology to suit the mapping.