Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] API as Ontology

Jean-Marc Vanel jeanmarc.vanel at gmail.com
Mon Aug 31 07:49:20 PDT 2009


I didn't quite understand your alternatives.
To be very concrete here is the translation I propose for :

public class Item {
  public String name; // or getName + setName
  public int unitPrice;
  public int computePrice( int quantity ) {return unitPrice*quantity;}
}
----------- OWL/N3 translation ------------------
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
@prefix um2: <http://schema.omg.org/spec/XMI/2.1/>.
:Item a owl:Class.
:name a owl:datatypeProperty;
          rdfs:label "name";
          rdfs:domain :Item;
          rdfs:range xsd:string.
:unitPrice a owl:datatypeProperty;
          rdfs:label "unitPrice";
          rdfs:domain :Item;
          rdfs:range xsd:positiveInteger.
:Item uml2:ownedOperation :computePrice.
:computePrice rdfs:label "computePrice";
          uml2:ownedParameter :quantity;
:quantity uml2:type xsd:positiveInteger;
          rdfs:label "quantity" .

Above I follow paragraph "7.2 Abstract Syntax" in "OMG Unified Modeling
Language (OMG UML),
Superstructure, V2.1.2",
except that I use XSD datatypes and rdfs:label as usual in OWL.

2009/8/31 Faraz Fallahi <faraz.fallahi at googlemail.com>

> Hi Jean-Marc,
>
> thx for the response. Right now my applied rules look like this:
>
> (1)
> Java class --> OWL class
> Java extended or implemented class -> OWL class which is subclassOf another
> OWL-class
> Java method --> OWL instanceOf the OWL class related to the method
>
> Combined with your idea i would conclude these rules:
>
> (2)
> Java class --> OWL class
> Java extended or implemented class -> OWL instance ("instance
> extends/implements class")
> Java method --> OWL property
>
> I dont think that i need a mapping from java Instance to OWL, because i
> just need a generell API-maping.
> UML would go a little over the top for me. but ill keep it in the back of
> my mind.
> Its a pity that there is no OWL equivalent of methods (functions). I think
> right now nothing seems to be against the use of alternative (2) but if you
> have other suggestions im happy to read them.
> Same applies for anyone else who has something to say about this :)
>
> greetings faraz
>
>
> 2009/8/31 Jean-Marc Vanel <jeanmarc.vanel at gmail.com>
>
> Hi Faraz
>>
>> If I understand well, you have a bunch of Java classes (or interfaces) ,
>> and you want to translate that into OWL.
>>
>> Obviously you want to apply these rules:
>>
>> Java class --> OWL class
>> Java properties (JavaBean properties) --> OWL property
>> Java instance --> OWL instance
>>
>> Now methods are a different beast. What I would do is add them as
>> predicates applied to the OWL classes, because there is no OWL equivalent of
>> methods (functions).
>> About the predicates and classes to use for modelling methods, I feel that
>> the best is to reuse an established vocabulary, namely UML.
>> Right now, with the EulerGUI project (http://eulergui.sourceforge.net/),
>> I'm working to translate all of UML2 metamodel into OWL. I already have a
>> raw N3 (RDF) representation of it, and I'm tuning the translation rules.
>> Please stay tuned:). But this not mandatory for your needs.
>>
>> To actually generate the OWL + UML annotations for methods, you could do
>> straightforward Java introspection, from Class to Method to parameters. Then
>> generate N3 turtle, much easier than RDF-XML.
>>
>> Hope this helps.
>>
>> 2009/8/31 Faraz Fallahi <faraz.fallahi at googlemail.com>
>>
>>>  hi
>>>
>>> im trying to generate an ontology out of an API. Now i wonder if how i
>>> should represent the different elements. Some essential questions bother me
>>> :
>>>
>>> Should an Object be represented as a concept or as an instance? When i
>>> represent them as concepts should a function be represented as the instance
>>> of its Object concept or is it better to represent functions as instances of
>>> a generell concept called "function"?
>>> My first thought was to represent classes (objects) as concepts and their
>>> functions as instances. I tried to google similar works for inspirations but
>>> with no success yet.
>>>
>>> I would really enjoy a little discussion about this and your thoughts. If
>>> you know about "API ontologies" i would really appreciate it if you could
>>> forward me.
>>>
>>> greetings
>>> faraz
>>>
>>> _______________________________________________
>>> protege-owl mailing list
>>> protege-owl at lists.stanford.edu
>>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>>
>>> Instructions for unsubscribing:
>>> http://protege.stanford.edu/doc/faq.html#01a.03
>>>
>>>
>>
>>
>> --
>> Jean-Marc Vanel
>> Consulting, services, training,
>> Rule-based programming, Semantic Web
>> http://jmvanel.free.fr/
>> +33 (0)6 89 16 29 52 -- +33 (0)1 39 55 58 16
>> ( we rarely listen to voice messages, please send a mail instead )
>>
>> _______________________________________________
>> protege-owl mailing list
>> protege-owl at lists.stanford.edu
>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>> Instructions for unsubscribing:
>> http://protege.stanford.edu/doc/faq.html#01a.03
>>
>>
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>
>


-- 
Jean-Marc Vanel
Consulting, services, training,
Rule-based programming, Semantic Web
http://jmvanel.free.fr/
+33 (0)6 89 16 29 52 -- +33 (0)1 39 55 58 16
( we rarely listen to voice messages, please send a mail instead )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20090831/032722eb/attachment.html>


More information about the protege-owl mailing list