rdf2owl

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

rdf2owl

Maciej Gawinecki-2

How can I convert RDF to OWL ?

Has anyone tried to prepare good tool for that ?

I tried to use RDF2OWL tool from Protege-OWL bundled with Protege
3.1.1

      OntModel model = ModelFactory.createOntologyModel();
      manager.readModel(model, args[0]);
      RDF2OWL tool = new RDF2OWL(model);
      tool.run();
      model.write(new DataOutputStream(new
        FileOutputStream(args[1])));

But this what I get on attached ontology:

*****************
[RDF2OWL] Replaced triple [http://www.ibspan.waw.pl/tss/Restaurant#Accessibility
Code, http://www.w3.org/2000/01/rdf-schema#subClassOf, http://www.w3.org/2000/01
/rdf-schema#Resource] with (x, x, owl:Thing)
Exception in thread "main" java.lang.UnsupportedOperationException
        at com.hp.hpl.jena.reasoner.rulesys.impl.LPTopGoalIterator.remove(LPTopG
oalIterator.java:176)
        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
java:69)
        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
java:69)
        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
java:69)
        at com.hp.hpl.jena.util.iterator.FilterIterator.remove(FilterIterator.ja
va:80)
        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
java:69)
        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
java:69)
        at com.hp.hpl.jena.rdf.model.impl.StmtIteratorImpl.remove(StmtIteratorIm
pl.java:37)
        at edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL.convertRDFSResourc
e(RDF2OWL.java:64)
        at edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL.run(RDF2OWL.java:9
8)
        at tool.rdf2owl.main(rdf2owl.java:27)
*****************

I also tried to rewrite the code to work only with Jena (2.3) but
there arises similar exception with iterator.remove() action.

Best regards,

Maciej

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

Re: rdf2owl

whetzel-2
Protege 3.2, build 318 has an option to create a new project from RDF
files. If you can open the RDF file in Protege and then export as OWL
perhaps that will help.

Trish


> How can I convert RDF to OWL ?
>
> Has anyone tried to prepare good tool for that ?
>
> I tried to use RDF2OWL tool from Protege-OWL bundled with Protege
> 3.1.1
>
>      OntModel model = ModelFactory.createOntologyModel();
>      manager.readModel(model, args[0]);
>      RDF2OWL tool = new RDF2OWL(model);
>      tool.run();
>      model.write(new DataOutputStream(new
>        FileOutputStream(args[1])));
>
> But this what I get on attached ontology:
>
> *****************
> [RDF2OWL] Replaced triple [http://www.ibspan.waw.pl/tss/Restaurant#Accessibility
> Code, http://www.w3.org/2000/01/rdf-schema#subClassOf, http://www.w3.org/2000/01
> /rdf-schema#Resource] with (x, x, owl:Thing)
> Exception in thread "main" java.lang.UnsupportedOperationException
>        at com.hp.hpl.jena.reasoner.rulesys.impl.LPTopGoalIterator.remove(LPTopG
> oalIterator.java:176)
>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
> java:69)
>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
> java:69)
>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
> java:69)
>        at com.hp.hpl.jena.util.iterator.FilterIterator.remove(FilterIterator.ja
> va:80)
>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
> java:69)
>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
> java:69)
>        at com.hp.hpl.jena.rdf.model.impl.StmtIteratorImpl.remove(StmtIteratorIm
> pl.java:37)
>        at edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL.convertRDFSResourc
> e(RDF2OWL.java:64)
>        at edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL.run(RDF2OWL.java:9
> 8)
>        at tool.rdf2owl.main(rdf2owl.java:27)
> *****************
>
> I also tried to rewrite the code to work only with Jena (2.3) but
> there arises similar exception with iterator.remove() action.
>
> Best regards,
>
> Maciej
>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>
-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

Re: rdf2owl

Maciej Gawinecki-2
Hello Trish,

Thank you for response.

Does this feature converse RDF into OWL in such a way it changes
rdfs:Class into owl:Class, rdf:Property into owl:ObjectProperty or
owl:DataProperty etc.   ????

If not then there is no change to Protege 3.1.1, which I have just
checked.

Best regards,

Maciej

Friday, May 5, 2006, 3:39:57 PM, you wrote:

> Protege 3.2, build 318 has an option to create a new project from RDF
> files. If you can open the RDF file in Protege and then export as OWL
> perhaps that will help.

> Trish


>> How can I convert RDF to OWL ?
>>
>> Has anyone tried to prepare good tool for that ?
>>
>> I tried to use RDF2OWL tool from Protege-OWL bundled with Protege
>> 3.1.1
>>
>>      OntModel model = ModelFactory.createOntologyModel();
>>      manager.readModel(model, args[0]);
>>      RDF2OWL tool = new RDF2OWL(model);
>>      tool.run();
>>      model.write(new DataOutputStream(new
>>        FileOutputStream(args[1])));
>>
>> But this what I get on attached ontology:
>>
>> *****************
>> [RDF2OWL] Replaced triple [http://www.ibspan.waw.pl/tss/Restaurant#Accessibility
>> Code, http://www.w3.org/2000/01/rdf-schema#subClassOf, http://www.w3.org/2000/01
>> /rdf-schema#Resource] with (x, x, owl:Thing)
>> Exception in thread "main" java.lang.UnsupportedOperationException
>>        at com.hp.hpl.jena.reasoner.rulesys.impl.LPTopGoalIterator.remove(LPTopG
>> oalIterator.java:176)
>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
>> java:69)
>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
>> java:69)
>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
>> java:69)
>>        at com.hp.hpl.jena.util.iterator.FilterIterator.remove(FilterIterator.ja
>> va:80)
>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
>> java:69)
>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove(WrappedIterator.
>> java:69)
>>        at com.hp.hpl.jena.rdf.model.impl.StmtIteratorImpl.remove(StmtIteratorIm
>> pl.java:37)
>>        at edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL.convertRDFSResourc
>> e(RDF2OWL.java:64)
>>        at edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL.run(RDF2OWL.java:9
>> 8)
>>        at tool.rdf2owl.main(rdf2owl.java:27)
>> *****************
>>
>> I also tried to rewrite the code to work only with Jena (2.3) but
>> there arises similar exception with iterator.remove() action.
>>
>> Best regards,
>>
>> Maciej
>>
>> -------------------------------------------------------------------------
>> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>>
> -------------------------------------------------------------------------
> To unsubscribe go to
> http://protege.stanford.edu/community/subscribe.html

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

Re: rdf2owl

Nick Drummond
Hi Maciej,

Unfortunately not, but if you make rdf/owl:Class visible you can do  
this painstakingly with the individuals tab.
I would suggest a small program to iterate through them and do it  
(you could implement an OWL Test plugin to do this).
I wish I had time to do it - I'll add it to the list.

Nick


On 5 May 2006, at 14:48, Maciej Gawinecki wrote:

> Hello Trish,
>
> Thank you for response.
>
> Does this feature converse RDF into OWL in such a way it changes
> rdfs:Class into owl:Class, rdf:Property into owl:ObjectProperty or
> owl:DataProperty etc.   ????
>
> If not then there is no change to Protege 3.1.1, which I have just
> checked.
>
> Best regards,
>
> Maciej
>
> Friday, May 5, 2006, 3:39:57 PM, you wrote:
>
>> Protege 3.2, build 318 has an option to create a new project from RDF
>> files. If you can open the RDF file in Protege and then export as OWL
>> perhaps that will help.
>
>> Trish
>
>
>>> How can I convert RDF to OWL ?
>>>
>>> Has anyone tried to prepare good tool for that ?
>>>
>>> I tried to use RDF2OWL tool from Protege-OWL bundled with Protege
>>> 3.1.1
>>>
>>>      OntModel model = ModelFactory.createOntologyModel();
>>>      manager.readModel(model, args[0]);
>>>      RDF2OWL tool = new RDF2OWL(model);
>>>      tool.run();
>>>      model.write(new DataOutputStream(new
>>>        FileOutputStream(args[1])));
>>>
>>> But this what I get on attached ontology:
>>>
>>> *****************
>>> [RDF2OWL] Replaced triple [http://www.ibspan.waw.pl/tss/ 
>>> Restaurant#Accessibility
>>> Code, http://www.w3.org/2000/01/rdf-schema#subClassOf, http://
>>> www.w3.org/2000/01
>>> /rdf-schema#Resource] with (x, x, owl:Thing)
>>> Exception in thread "main" java.lang.UnsupportedOperationException
>>>        at  
>>> com.hp.hpl.jena.reasoner.rulesys.impl.LPTopGoalIterator.remove
>>> (LPTopG
>>> oalIterator.java:176)
>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>> (WrappedIterator.
>>> java:69)
>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>> (WrappedIterator.
>>> java:69)
>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>> (WrappedIterator.
>>> java:69)
>>>        at com.hp.hpl.jena.util.iterator.FilterIterator.remove
>>> (FilterIterator.ja
>>> va:80)
>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>> (WrappedIterator.
>>> java:69)
>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>> (WrappedIterator.
>>> java:69)
>>>        at com.hp.hpl.jena.rdf.model.impl.StmtIteratorImpl.remove
>>> (StmtIteratorIm
>>> pl.java:37)
>>>        at  
>>> edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL.convertRDFSResour
>>> c
>>> e(RDF2OWL.java:64)
>>>        at edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL.run
>>> (RDF2OWL.java:9
>>> 8)
>>>        at tool.rdf2owl.main(rdf2owl.java:27)
>>> *****************
>>>
>>> I also tried to rewrite the code to work only with Jena (2.3) but
>>> there arises similar exception with iterator.remove() action.
>>>
>>> Best regards,
>>>
>>> Maciej
>>>
>>> --------------------------------------------------------------------
>>> -----
>>> To unsubscribe go to http://protege.stanford.edu/community/ 
>>> subscribe.html
>>>
>> ---------------------------------------------------------------------
>> ----
>> To unsubscribe go to
>> http://protege.stanford.edu/community/subscribe.html
>
> ----------------------------------------------------------------------
> ---
> To unsubscribe go to http://protege.stanford.edu/community/ 
> subscribe.html
>

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

[POSSIBLE VIRUS:###] Re: rdf2owl

Maciej Gawinecki-2

Hi Nick,

I can try but I found in Protege interesting class

  edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL

Does author

 Holger Knublauch

of the class is alive and tracks this forum ?

What was the base for translation RDF into OWL ?
Maybe this :

   OWL Web Ontology Language Parsing OWL in RDF/XML
   http://www.w3.org/TR/owl-parsing/

?

In my opinion this is serious problem, since OWL was planned to be a
standard build over RDF and then I suppose each RDF(S) ontology could be
expressed in pure OWL (e.g. rdfs:Class goes into owl:Class). I wonder
in what a way anyone of you tried to re-use one of many existing RDF
ontologies as an OWL one ?

Doesn't a reasoner care whether it is OWL or RDF ?

And why there are no translators ? Is there any problem in making it ?
I found some XSLT ideas to do that but
"but it relied on specific predictable structures in the doc (range
Literal is handy for ObjectProperty/DataProperty ;-) "

all the best,

Maciej

> Hi Maciej,

> Unfortunately not, but if you make rdf/owl:Class visible you can do  
> this painstakingly with the individuals tab.
> I would suggest a small program to iterate through them and do it  
> (you could implement an OWL Test plugin to do this).
> I wish I had time to do it - I'll add it to the list.

> Nick


> On 5 May 2006, at 14:48, Maciej Gawinecki wrote:

>> Hello Trish,
>>
>> Thank you for response.
>>
>> Does this feature converse RDF into OWL in such a way it changes
>> rdfs:Class into owl:Class, rdf:Property into owl:ObjectProperty or
>> owl:DataProperty etc.   ????
>>
>> If not then there is no change to Protege 3.1.1, which I have just
>> checked.
>>
>> Best regards,
>>
>> Maciej
>>
>> Friday, May 5, 2006, 3:39:57 PM, you wrote:
>>
>>> Protege 3.2, build 318 has an option to create a new project from RDF
>>> files. If you can open the RDF file in Protege and then export as OWL
>>> perhaps that will help.
>>
>>> Trish
>>
>>
>>>> How can I convert RDF to OWL ?
>>>>
>>>> Has anyone tried to prepare good tool for that ?
>>>>
>>>> I tried to use RDF2OWL tool from Protege-OWL bundled with Protege
>>>> 3.1.1
>>>>
>>>>      OntModel model = ModelFactory.createOntologyModel();
>>>>      manager.readModel(model, args[0]);
>>>>      RDF2OWL tool = new RDF2OWL(model);
>>>>      tool.run();
>>>>      model.write(new DataOutputStream(new
>>>>        FileOutputStream(args[1])));
>>>>
>>>> But this what I get on attached ontology:
>>>>
>>>> *****************
>>>> [RDF2OWL] Replaced triple [http://www.ibspan.waw.pl/tss/ 
>>>> Restaurant#Accessibility
>>>> Code, http://www.w3.org/2000/01/rdf-schema#subClassOf, http://
>>>> www.w3.org/2000/01
>>>> /rdf-schema#Resource] with (x, x, owl:Thing)
>>>> Exception in thread "main" java.lang.UnsupportedOperationException
>>>>        at  
>>>> com.hp.hpl.jena.reasoner.rulesys.impl.LPTopGoalIterator.remove
>>>> (LPTopG
>>>> oalIterator.java:176)
>>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>>> (WrappedIterator.
>>>> java:69)
>>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>>> (WrappedIterator.
>>>> java:69)
>>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>>> (WrappedIterator.
>>>> java:69)
>>>>        at com.hp.hpl.jena.util.iterator.FilterIterator.remove
>>>> (FilterIterator.ja
>>>> va:80)
>>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>>> (WrappedIterator.
>>>> java:69)
>>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>>> (WrappedIterator.
>>>> java:69)
>>>>        at com.hp.hpl.jena.rdf.model.impl.StmtIteratorImpl.remove
>>>> (StmtIteratorIm
>>>> pl.java:37)
>>>>        at  
>>>> edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL.convertRDFSResour
>>>> c
>>>> e(RDF2OWL.java:64)
>>>>        at edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL.run
>>>> (RDF2OWL.java:9
>>>> 8)
>>>>        at tool.rdf2owl.main(rdf2owl.java:27)
>>>> *****************
>>>>
>>>> I also tried to rewrite the code to work only with Jena (2.3) but
>>>> there arises similar exception with iterator.remove() action.
>>>>
>>>> Best regards,
>>>>
>>>> Maciej
>>>>
>>>> --------------------------------------------------------------------
>>>> -----
>>>> To unsubscribe go to http://protege.stanford.edu/community/ 
>>>> subscribe.html
>>>>
>>> ---------------------------------------------------------------------
>>> ----
>>> To unsubscribe go to
>>> http://protege.stanford.edu/community/subscribe.html
>>
>> ----------------------------------------------------------------------
>> ---
>> To unsubscribe go to http://protege.stanford.edu/community/ 
>> subscribe.html
>>

> -------------------------------------------------------------------------
> To unsubscribe go to
> http://protege.stanford.edu/community/subscribe.html



Hi Nick,

I can try but I found in Protege interesting class

  edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL

Does author

 Holger Knublauch

of the class is alive and tracks this forum ?

What was the base for translation RDF into OWL ?
Maybe this :

   OWL Web Ontology Language Parsing OWL in RDF/XML
   http://www.w3.org/TR/owl-parsing/

?

In my opinion this is serious problem, since OWL was planned to be a
standard build over RDF and then I suppose each RDF(S) ontology could be
expressed in pure OWL (e.g. rdfs:Class goes into owl:Class). I wonder
in what a way anyone of you tried to re-use one of many existing RDF
ontologies as an OWL one ?

Doesn't a reasoner care whether it is OWL or RDF ?

And why there are no translators ? Is there any problem in making it ?
I found some XSLT ideas to do that but
"but it relied on specific predictable structures in the doc (range
Literal is handy for ObjectProperty/DataProperty ;-) "

all the best,

Maciej

> Hi Maciej,

> Unfortunately not, but if you make rdf/owl:Class visible you can do  
> this painstakingly with the individuals tab.
> I would suggest a small program to iterate through them and do it  
> (you could implement an OWL Test plugin to do this).
> I wish I had time to do it - I'll add it to the list.

> Nick


> On 5 May 2006, at 14:48, Maciej Gawinecki wrote:

>> Hello Trish,
>>
>> Thank you for response.
>>
>> Does this feature converse RDF into OWL in such a way it changes
>> rdfs:Class into owl:Class, rdf:Property into owl:ObjectProperty or
>> owl:DataProperty etc.   ????
>>
>> If not then there is no change to Protege 3.1.1, which I have just
>> checked.
>>
>> Best regards,
>>
>> Maciej
>>
>> Friday, May 5, 2006, 3:39:57 PM, you wrote:
>>
>>> Protege 3.2, build 318 has an option to create a new project from RDF
>>> files. If you can open the RDF file in Protege and then export as OWL
>>> perhaps that will help.
>>
>>> Trish
>>
>>
>>>> How can I convert RDF to OWL ?
>>>>
>>>> Has anyone tried to prepare good tool for that ?
>>>>
>>>> I tried to use RDF2OWL tool from Protege-OWL bundled with Protege
>>>> 3.1.1
>>>>
>>>>      OntModel model = ModelFactory.createOntologyModel();
>>>>      manager.readModel(model, args[0]);
>>>>      RDF2OWL tool = new RDF2OWL(model);
>>>>      tool.run();
>>>>      model.write(new DataOutputStream(new
>>>>        FileOutputStream(args[1])));
>>>>
>>>> But this what I get on attached ontology:
>>>>
>>>> *****************
>>>> [RDF2OWL] Replaced triple [http://www.ibspan.waw.pl/tss/ 
>>>> Restaurant#Accessibility
>>>> Code, http://www.w3.org/2000/01/rdf-schema#subClassOf, http://
>>>> www.w3.org/2000/01
>>>> /rdf-schema#Resource] with (x, x, owl:Thing)
>>>> Exception in thread "main" java.lang.UnsupportedOperationException
>>>>        at  
>>>> com.hp.hpl.jena.reasoner.rulesys.impl.LPTopGoalIterator.remove
>>>> (LPTopG
>>>> oalIterator.java:176)
>>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>>> (WrappedIterator.
>>>> java:69)
>>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>>> (WrappedIterator.
>>>> java:69)
>>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>>> (WrappedIterator.
>>>> java:69)
>>>>        at com.hp.hpl.jena.util.iterator.FilterIterator.remove
>>>> (FilterIterator.ja
>>>> va:80)
>>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>>> (WrappedIterator.
>>>> java:69)
>>>>        at com.hp.hpl.jena.util.iterator.WrappedIterator.remove
>>>> (WrappedIterator.
>>>> java:69)
>>>>        at com.hp.hpl.jena.rdf.model.impl.StmtIteratorImpl.remove
>>>> (StmtIteratorIm
>>>> pl.java:37)
>>>>        at  
>>>> edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL.convertRDFSResour
>>>> c
>>>> e(RDF2OWL.java:64)
>>>>        at edu.stanford.smi.protegex.owl.jena.rdf2owl.RDF2OWL.run
>>>> (RDF2OWL.java:9
>>>> 8)
>>>>        at tool.rdf2owl.main(rdf2owl.java:27)
>>>> *****************
>>>>
>>>> I also tried to rewrite the code to work only with Jena (2.3) but
>>>> there arises similar exception with iterator.remove() action.
>>>>
>>>> Best regards,
>>>>
>>>> Maciej
>>>>
>>>> --------------------------------------------------------------------
>>>> -----
>>>> To unsubscribe go to http://protege.stanford.edu/community/ 
>>>> subscribe.html
>>>>
>>> ---------------------------------------------------------------------
>>> ----
>>> To unsubscribe go to
>>> http://protege.stanford.edu/community/subscribe.html
>>
>> ----------------------------------------------------------------------
>> ---
>> To unsubscribe go to http://protege.stanford.edu/community/ 
>> subscribe.html
>>

> -------------------------------------------------------------------------
> To unsubscribe go to
> http://protege.stanford.edu/community/subscribe.html






--
Pozdrowienia,
 Maciej Gawinecki