0

My work requires a construction of ontologies modules. For this I need to construct owl files to contain those ontologies. My input is an xml file with parsed and splitted sentences.

<Subject> A tumor </Subject> 
<Verb> is </Verb> 
<Object> an abnormal growth </Object> 
</sentence> 
<sentence> 
<Subject> A kidney tumor </Subject> 
<Verb> is </Verb> 
<Object> an abnormal growth </Object> 

What I need to do now is:

  • convert "subject" and "object" into OntClass
  • convert "verb" into a transitive property between "obj" and "sub"

I am new on the ontology domain, may be those are basic questions, but I am struggling with the creation of those files, and especially with the transitive property.

Any help is welcome.

Rohan Pillai
  • 917
  • 3
  • 17
  • 26
safé
  • 175
  • 3
  • 12

1 Answers1

2

To create an OntClass, you simply need to call OntModel.createClass( uri ). Of course, that then leaves the question of which uri you should use. You'll need a namespace, something of the form http://yourcompany.com/ontology/diagnosis#; ideally this namespace will correspond to a web address where your ontology document can be retrieved.

Then you'll need an algorithm for converting a phrase like 'A tumor' into a class name. This could be quite simple:

  • remove prefixes such as definite and indefinite articles (a, an, the)
  • remove spaces and use CamelCase to denote word boundaries

Then the uri will be the concatenation of the namespace and the converted name.

Creating transitive properties is also straightforward (OntModel.createTransitiveProperty()), but in the sample that you show, it appears that you're actually talking about the sub-class relationship between classes. If it is always true that all ns:KidneyTumor instances are also in the set of ns:AbnormalGrowth instances, then your <Verb>is</Verb> corresponds to the existing RDF property rdfs:subClassOf. Of course, if that relationship is more subtle (e.g. may be conditionally or probabilistically true), then you'll need a different relationship with your particular semantics.

As for reading the XML file, there are many tutorials on the web or questions on Stackoverflow to help with that.

Community
  • 1
  • 1
Ian Dickinson
  • 12,875
  • 11
  • 40
  • 67
  • thank you, i have no problem with reading the xml file. However, not all the times my verb is "is", it can be any type of verbs, in fact i want to build non-taxonomic relations. – safé May 12 '11 at 09:29
  • Well, as I said, if your semantics are not the same as existing predicates you should of course create new predicates. The point I was making was that you should re-use existing predicates where possible, for interoperability with other ontologies and tools. Re XML, your question listed "reading the XML file" as one of the topics you welcomed help on. – Ian Dickinson May 12 '11 at 10:52
  • It would be interesting to use those predicates, but then my relations will be classified as taxonomic, isn't? (I am new at ontology domain) And you're right about the xml point, I deleted it. – safé May 12 '11 at 11:12
  • Only you can know the semantics of the relationships that you're trying to model. If those semantics match the semantics of existing (and well-known) relationships, it's best practice to re-use them rather than invent your own. Especially if you eventually expect other people to be able to build on your work. However I don't know what "being classified as taxonomic" means to you or your application, and whether that would be bad. Ultimately, if the hat *doesn't* fit then don't wear it! – Ian Dickinson May 12 '11 at 13:52