You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by kumar rohit <ku...@gmail.com> on 2015/08/20 09:41:15 UTC

RDF or OWL

Suppose a Protege file which is saved as "module.owl" in Rdf/xml serialized
form and we want to import it in Jena, what classes will we use? I mean RDF
classes like

Model model = ModelFactory.createDefaultModel();

OR Ontmodel classes and methods like

OntModel m = ModelFactory.createOntologyModel();
		

I am confused so kindly explain the situation when to use RDF and when
to use OWL classes when working on Protege and Jena.

Re: RDF or OWL

Posted by Rob Walpole <ro...@gmail.com>.
Just a heads up that for more general Semantic Web question you should
probably go somewhere like http://answers.semanticweb.com/ as this mailing
list is Jena specific :)

Rob

Rob Walpole
Email robkwalpole@gmail.com
Tel. +44 (0)7969 869881http://www.linkedin.com/in/robwalpole


On Thu, Aug 20, 2015 at 1:05 PM, Rob Walpole <ro...@gmail.com> wrote:

> It's all RDF. OWL is expressed as RDF. I think perhaps you mean RDFS? If
> you have an OWL ontology then all of your classes are (at the deepest
> level) subclasses of owl:Thing. If you have created an RDFS vocabulary then
> all of your classes are subclasses of rdfs:Class. I'm guessing that you
> have created an OWL vocabulary if you have saved it with the owl extension.
>
> Rob
>
> Rob Walpole
> Email robkwalpole@gmail.com
> Tel. +44 (0)7969 869881http://www.linkedin.com/in/robwalpole
>
>
> On Thu, Aug 20, 2015 at 12:50 PM, kumar rohit <ku...@gmail.com>
> wrote:
>
>> Thank you but what about RDF models and classes? Is it replaced by OWL ?
>>
>> On Thu, Aug 20, 2015 at 11:52 AM, Rob Walpole <ro...@gmail.com>
>> wrote:
>>
>> > You will need use an OntModel if you want to instantiate your OWL
>> classes.
>> > I assume your vocabulary is actually based on OWL, i.e. all your classes
>> > are subclasses of owl:Thing - so if you want to use these in your Java
>> code
>> > - perhaps to write queries - you will need to instantiate them something
>> > like this:
>> >
>> > OntClass MY_OWL_CLASS = MODEL.createClass(MY_VOCAB_URI + "MyClassName");
>> >
>> > Where MODEL is an instance of OntModel create something like this:
>> >
>> > OntModel MODEL =
>> ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
>> >
>> > I believe you can also extract inferred triples from an OntModel but I
>> > haven't tried this myself.
>> >
>> > Rob
>> >
>> > Rob Walpole
>> > Email robkwalpole@gmail.com
>> > Tel. +44 (0)7969 869881http://www.linkedin.com/in/robwalpole
>> >
>> >
>> > On Thu, Aug 20, 2015 at 8:41 AM, kumar rohit <ku...@gmail.com>
>> > wrote:
>> >
>> > > Suppose a Protege file which is saved as "module.owl" in Rdf/xml
>> > serialized
>> > > form and we want to import it in Jena, what classes will we use? I
>> mean
>> > RDF
>> > > classes like
>> > >
>> > > Model model = ModelFactory.createDefaultModel();
>> > >
>> > > OR Ontmodel classes and methods like
>> > >
>> > > OntModel m = ModelFactory.createOntologyModel();
>> > >
>> > >
>> > > I am confused so kindly explain the situation when to use RDF and when
>> > > to use OWL classes when working on Protege and Jena.
>> > >
>> >
>>
>
>

Re: RDF or OWL

Posted by Rob Walpole <ro...@gmail.com>.
It's all RDF. OWL is expressed as RDF. I think perhaps you mean RDFS? If
you have an OWL ontology then all of your classes are (at the deepest
level) subclasses of owl:Thing. If you have created an RDFS vocabulary then
all of your classes are subclasses of rdfs:Class. I'm guessing that you
have created an OWL vocabulary if you have saved it with the owl extension.

Rob

Rob Walpole
Email robkwalpole@gmail.com
Tel. +44 (0)7969 869881http://www.linkedin.com/in/robwalpole


On Thu, Aug 20, 2015 at 12:50 PM, kumar rohit <ku...@gmail.com> wrote:

> Thank you but what about RDF models and classes? Is it replaced by OWL ?
>
> On Thu, Aug 20, 2015 at 11:52 AM, Rob Walpole <ro...@gmail.com>
> wrote:
>
> > You will need use an OntModel if you want to instantiate your OWL
> classes.
> > I assume your vocabulary is actually based on OWL, i.e. all your classes
> > are subclasses of owl:Thing - so if you want to use these in your Java
> code
> > - perhaps to write queries - you will need to instantiate them something
> > like this:
> >
> > OntClass MY_OWL_CLASS = MODEL.createClass(MY_VOCAB_URI + "MyClassName");
> >
> > Where MODEL is an instance of OntModel create something like this:
> >
> > OntModel MODEL =
> ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
> >
> > I believe you can also extract inferred triples from an OntModel but I
> > haven't tried this myself.
> >
> > Rob
> >
> > Rob Walpole
> > Email robkwalpole@gmail.com
> > Tel. +44 (0)7969 869881http://www.linkedin.com/in/robwalpole
> >
> >
> > On Thu, Aug 20, 2015 at 8:41 AM, kumar rohit <ku...@gmail.com>
> > wrote:
> >
> > > Suppose a Protege file which is saved as "module.owl" in Rdf/xml
> > serialized
> > > form and we want to import it in Jena, what classes will we use? I mean
> > RDF
> > > classes like
> > >
> > > Model model = ModelFactory.createDefaultModel();
> > >
> > > OR Ontmodel classes and methods like
> > >
> > > OntModel m = ModelFactory.createOntologyModel();
> > >
> > >
> > > I am confused so kindly explain the situation when to use RDF and when
> > > to use OWL classes when working on Protege and Jena.
> > >
> >
>

Re: RDF or OWL

Posted by kumar rohit <ku...@gmail.com>.
Thank you but what about RDF models and classes? Is it replaced by OWL ?

On Thu, Aug 20, 2015 at 11:52 AM, Rob Walpole <ro...@gmail.com> wrote:

> You will need use an OntModel if you want to instantiate your OWL classes.
> I assume your vocabulary is actually based on OWL, i.e. all your classes
> are subclasses of owl:Thing - so if you want to use these in your Java code
> - perhaps to write queries - you will need to instantiate them something
> like this:
>
> OntClass MY_OWL_CLASS = MODEL.createClass(MY_VOCAB_URI + "MyClassName");
>
> Where MODEL is an instance of OntModel create something like this:
>
> OntModel MODEL = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
>
> I believe you can also extract inferred triples from an OntModel but I
> haven't tried this myself.
>
> Rob
>
> Rob Walpole
> Email robkwalpole@gmail.com
> Tel. +44 (0)7969 869881http://www.linkedin.com/in/robwalpole
>
>
> On Thu, Aug 20, 2015 at 8:41 AM, kumar rohit <ku...@gmail.com>
> wrote:
>
> > Suppose a Protege file which is saved as "module.owl" in Rdf/xml
> serialized
> > form and we want to import it in Jena, what classes will we use? I mean
> RDF
> > classes like
> >
> > Model model = ModelFactory.createDefaultModel();
> >
> > OR Ontmodel classes and methods like
> >
> > OntModel m = ModelFactory.createOntologyModel();
> >
> >
> > I am confused so kindly explain the situation when to use RDF and when
> > to use OWL classes when working on Protege and Jena.
> >
>

Re: RDF or OWL

Posted by Rob Walpole <ro...@gmail.com>.
You will need use an OntModel if you want to instantiate your OWL classes.
I assume your vocabulary is actually based on OWL, i.e. all your classes
are subclasses of owl:Thing - so if you want to use these in your Java code
- perhaps to write queries - you will need to instantiate them something
like this:

OntClass MY_OWL_CLASS = MODEL.createClass(MY_VOCAB_URI + "MyClassName");

Where MODEL is an instance of OntModel create something like this:

OntModel MODEL = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);

I believe you can also extract inferred triples from an OntModel but I
haven't tried this myself.

Rob

Rob Walpole
Email robkwalpole@gmail.com
Tel. +44 (0)7969 869881http://www.linkedin.com/in/robwalpole


On Thu, Aug 20, 2015 at 8:41 AM, kumar rohit <ku...@gmail.com> wrote:

> Suppose a Protege file which is saved as "module.owl" in Rdf/xml serialized
> form and we want to import it in Jena, what classes will we use? I mean RDF
> classes like
>
> Model model = ModelFactory.createDefaultModel();
>
> OR Ontmodel classes and methods like
>
> OntModel m = ModelFactory.createOntologyModel();
>
>
> I am confused so kindly explain the situation when to use RDF and when
> to use OWL classes when working on Protege and Jena.
>