0

In Protégé, I've created an ontology with classes Service, Attributes, etc., and an object property hasAttributes as follow:

Service has Attributes Attributes (serviceIdentifier:String, Type(String), Description (sting), providerIdentifier (String), InputParameter ( ), OutputParameter (), price (Integer)

My question is: must we consider serviceidentifier, type, description, etc., as subclasses or data properties of the class Attributes?

the ontology is as follow:

<?xml version="1.0"?>


<!DOCTYPE Ontology [
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY xml "http://www.w3.org/XML/1998/namespace" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>


<Ontology xmlns="http://www.w3.org/2002/07/owl#"
     xml:base="http://www.semanticweb.org/acer/ontologies/2014/1/untitled-ontology-56"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     ontologyIRI="http://www.semanticweb.org/acer/ontologies/2014/1/untitled-ontology-56">
    <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>
    <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
    <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
    <Declaration>
        <Class IRI="#attributes"/>
    </Declaration>
    <Declaration>
        <Class IRI="#capsule"/>
    </Declaration>
    <Declaration>
        <Class IRI="#requirement"/>
    </Declaration>
    <Declaration>
        <Class IRI="#service"/>
    </Declaration>
    <Declaration>
        <ObjectProperty IRI="#hasAttribute"/>
    </Declaration>
    <Declaration>
        <ObjectProperty IRI="#hasCapsule"/>
    </Declaration>
    <Declaration>
        <ObjectProperty IRI="#hasRequirement"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#description"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#diskFree"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#diskFreeUnit"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#diskFreeValue"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#inputParameter"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#location"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#memoryFree"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#memoryFreeUnit"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#memoryFreeValue"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#numInstance"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#operationSystem"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#outputParameter"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#port"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#price"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#protocol"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#providerIdentifier"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#serviceIdentifier"/>
    </Declaration>
    <Declaration>
        <DataProperty IRI="#type"/>
    </Declaration>
    <SubClassOf>
        <Class IRI="#attributes"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#description"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#attributes"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#inputParameter"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#attributes"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#numInstance"/>
            <Datatype abbreviatedIRI="xsd:integer"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#attributes"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#outputParameter"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#attributes"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#price"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#attributes"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#providerIdentifier"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#attributes"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#serviceIdentifier"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#attributes"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#type"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#capsule"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#location"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#capsule"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#port"/>
            <Datatype abbreviatedIRI="xsd:integer"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#capsule"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#protocol"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#requirement"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#diskFreeUnit"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#requirement"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#diskFreeValue"/>
            <Datatype abbreviatedIRI="xsd:integer"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#requirement"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#memoryFreeUnit"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#requirement"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#memoryFreeValue"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#requirement"/>
        <DataAllValuesFrom>
            <DataProperty IRI="#operationSystem"/>
            <Datatype abbreviatedIRI="xsd:string"/>
        </DataAllValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#service"/>
        <ObjectSomeValuesFrom>
            <ObjectProperty IRI="#hasAttribute"/>
            <Class IRI="#attributes"/>
        </ObjectSomeValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#service"/>
        <ObjectSomeValuesFrom>
            <ObjectProperty IRI="#hasCapsule"/>
            <Class IRI="#capsule"/>
        </ObjectSomeValuesFrom>
    </SubClassOf>
    <SubClassOf>
        <Class IRI="#service"/>
        <ObjectSomeValuesFrom>
            <ObjectProperty IRI="#hasRequirement"/>
            <Class IRI="#requirement"/>
        </ObjectSomeValuesFrom>
    </SubClassOf>
    <SubDataPropertyOf>
        <DataProperty IRI="#diskFreeUnit"/>
        <DataProperty IRI="#diskFree"/>
    </SubDataPropertyOf>
    <SubDataPropertyOf>
        <DataProperty IRI="#diskFreeValue"/>
        <DataProperty IRI="#diskFree"/>
    </SubDataPropertyOf>
    <SubDataPropertyOf>
        <DataProperty IRI="#memoryFreeUnit"/>
        <DataProperty IRI="#memoryFree"/>
    </SubDataPropertyOf>
    <SubDataPropertyOf>
        <DataProperty IRI="#memoryFreeValue"/>
        <DataProperty IRI="#memoryFree"/>
    </SubDataPropertyOf>
</Ontology>



<!-- Generated by the OWL API (version 3.4.2) http://owlapi.sourceforge.net -->
Nanis
  • 71
  • 1
  • 10
  • 1
    It would be helpful if you can post your ontology. At the moment it's a bit hard to tell exactly what you're asking. – Joshua Taylor Feb 24 '14 at 19:31
  • 1
    This does not look like a minimal example of an ontology illustrating your problem. Are you certain you can't make a smaller example that shows the issue? – Joshua Taylor Feb 26 '14 at 20:43

1 Answers1

2

As the question is written now, it's a little bit hard to tell what you asking, but if I understand you correctly, my impression is that you currently have two classes:

  • Service
  • Attribute

and that a service can be related to an Attribute by the hasAttribute property. In addition, each Attribute is described by some values for a number of properties:

  • serviceIdentifier (range: String)
  • type (range: String)
  • description (range: String)
  • inputParameter (range: unspecified)
  • outputParameter (range: unspecified)
  • price (range: integer)

That means that you might have data that looks something like this:

:service72 :hasAttribute _:attr1 .
_:attr1 rdf:type :Attribute .
_:attr1 :price 73 .

Unless you actually need to refer to instances of Attributes for some reason, this representation seems a bit more complicated than it needs to be. As to the particular question:

must we consider serviceidentifier, type, description, etc., as subclasses or data properties of the class Attributes?

You could declare, e.g., ServiceIdentifier as a subclass of Attribute, but if the important value for service provider is a string, then you'd still need a data property that relates instances of ServiceIdentifier to the string that actually identifies the service. That is, you'd end up with data like this:

:service72 :hasAttribute _:attr
_:attr rdf:type :ServiceIdentifier .
_:attr :hasServiceIdentifierString "service identification"

Object properties relate individuals to other individuals, and data properties relate individuals to literal data. If you make hasAttribute an object property, then Attributes must be individuals and different kinds of attributes could be subclasses of Attrbute, but you'll need data properties to relate the instances of Attribute to the actual attribute values.

I think you could just as easily make hasAttribute a data property, and then declare these properties as data properties that are subproperties of hasAttribute. That is, you'd have a property hierarchy like this:

  • hasAttribute (range: unspecified)
    • serviceIdentifier (range: string)
    • type (range: string)
    • description (range: string)

Then you can have data like this:

:service72 :serviceIdentifier "some identification" .
:service72 :type "my favorite service" .
:service72 :price 32 .

Then, because those properties are subproperties of hasAttribute, if you use a reasoner, you can still infer the following triples if you need them:

:service72 :hasAttribute "some identification" .
:service72 :hasAttribute "my favorite service" .
:service72 :hasAttribute 32 .

In general, it might not be a bad idea to use the least amount of structure necessary early on, and to refine your ontology as you make progress and need a bit more structure.

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Thanks for you answer but please, can I send you my ontology because I've not well understand your explanation. – Nanis Feb 26 '14 at 18:34
  • 1
    @user3347859 There's an edit link underneath your question. As I noted in a comment there, you should copy and paste your ontology as code into the question. – Joshua Taylor Feb 26 '14 at 18:36
  • I have a message: too long by 6416 characters – Nanis Feb 26 '14 at 19:32
  • 1
    @user3347859 You're probably trying to show too much then; you surely don't need the whole ontology to illustrate what you're trying to do. Try to [create a Minimal, Complete, Tested and Readable example](http://stackoverflow.com/help/mcve). Also see [SSCCE](http://www.sscce.org/). Start from scratch, put together just enough to illustrate the problem. This is standard good debugging practice. Also, this is discussion about the question, not about my particular answer. let's put future comments on the question, rather than this answer. – Joshua Taylor Feb 26 '14 at 19:38
  • @user3347859 No. Add the ontology to the question. Please don't post it as a comment, and especially not as a comment on an answer. – Joshua Taylor Feb 26 '14 at 19:43
  • @user3347859 Did you read [my previous comment](http://stackoverflow.com/questions/21995843/owl-ontology-data-properties/21997409?noredirect=1#comment33435472_21997409)? – Joshua Taylor Feb 26 '14 at 19:48
  • user Joshua Taylor Yes, I did. – Nanis Feb 26 '14 at 20:14