You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Steve Vestal <st...@adventiumlabs.com> on 2020/04/28 23:30:54 UTC

OWL.Thing as an OntClass?

OWL.Thing is a Resource.  The OWL standard says "Declaration( Class(
owl:Thing ) ) " is a declaration of this built-in entity, but a class
cast (OntClass) OWL.Thing fails.  The following also fails.

Resource owlThing = OWL.Thing;
OntClass classThing = owlThing.as(OntClass.class);

Is there a way to get OWL.Thing as an OntClass?


Re: OWL.Thing as an OntClass?

Posted by Steve Vestal <st...@adventiumlabs.com>.
Ah, so is the rule that an OntClass object, unlike a Resource, only
exists within the context of a specific OntModel?  Seems a reasonable
general rule to follow for all the OntModel classes.  Thanks.

On 4/29/2020 1:37 AM, Lorenz Buehmann wrote:
> Can't you just use the URI?Like
>
> OntModel m = ...
> OntClass owlThing = m.createClass(OWL.Thing.getURI());
>
> or
>
> OntClass owlThing = (OntClass) m.createOntResource( OntClass.class,
> null, OWL.Thing.getURI());
>
> On 29.04.20 01:30, Steve Vestal wrote:
>> OWL.Thing is a Resource.  The OWL standard says "Declaration( Class(
>> owl:Thing ) ) " is a declaration of this built-in entity, but a class
>> cast (OntClass) OWL.Thing fails.  The following also fails.
>>
>> Resource owlThing = OWL.Thing;
>> OntClass classThing = owlThing.as(OntClass.class);
>>
>> Is there a way to get OWL.Thing as an OntClass?
>>

Re: OWL.Thing as an OntClass?

Posted by Lorenz Buehmann <bu...@informatik.uni-leipzig.de>.
Can't you just use the URI?Like

OntModel m = ...
OntClass owlThing = m.createClass(OWL.Thing.getURI());

or

OntClass owlThing = (OntClass) m.createOntResource( OntClass.class,
null, OWL.Thing.getURI());

On 29.04.20 01:30, Steve Vestal wrote:
> OWL.Thing is a Resource.  The OWL standard says "Declaration( Class(
> owl:Thing ) ) " is a declaration of this built-in entity, but a class
> cast (OntClass) OWL.Thing fails.  The following also fails.
>
> Resource owlThing = OWL.Thing;
> OntClass classThing = owlThing.as(OntClass.class);
>
> Is there a way to get OWL.Thing as an OntClass?
>