You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by tina sani <ti...@gmail.com> on 2017/02/15 12:11:46 UTC

Remove class

For example, I have added some classes for an individual using rules.
emplyee 1 is type of Manager, Programmer, Worker.

Can I replace these classes with one class like
if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
(emp1.hasOntClass(worker)  then emp1 should be type of one class Employee
and replace/remove these three classes.?

There is one method, I dont know if it is suitable here to apply?

Individual.removeOntClass(Resource)
<https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.jena.rdf.model.Resource->

Re: Remove class

Posted by "A. Soroka" <aj...@virginia.edu>.
Please suggest to your teacher that when he or she gives such an assignment (to use Jena rules) it would be useful and helpful to contact this list first. There are many people here who would be happy to help advise your teacher and make the assignment as good as it can be.

---
A. Soroka
The University of Virginia Library

> On Feb 15, 2017, at 8:57 AM, tina sani <ti...@gmail.com> wrote:
> 
> yes,
> 
> On Wed, Feb 15, 2017 at 4:55 PM, A. Soroka <aj...@virginia.edu> wrote:
> 
>> Can you tell us something about this project? Is this a school assignment?
>> 
>> ---
>> A. Soroka
>> The University of Virginia Library
>> 
>>> On Feb 15, 2017, at 8:54 AM, tina sani <ti...@gmail.com> wrote:
>>> 
>>> Lorenz, using rules in my project is mandatory part so need to stick with
>>> it.
>>> 
>>> On Wed, Feb 15, 2017 at 4:50 PM, Chris Dollin <
>> chris.dollin@epimorphics.com>
>>> wrote:
>>> 
>>>> On 15 February 2017 at 13:06, tina sani <ti...@gmail.com> wrote:
>>>> 
>>>>> Hello Lorenz, so no way to remove or replace these classes?
>>>>> setOntClass also not working, I have tried it.
>>>>> 
>>>> 
>>>> If you don't want inference to add back the statements
>>>> you have deleted
>>>> 
>>>> Then don't use inference to add the statements in
>>>> the first place
>>>> 
>>>> Then you can add and remove statements as you like
>>>> 
>>>> Chris
>>>> 
>>>> 
>>>>> On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
>>>>> buehmann@informatik.uni-leipzig.de> wrote:
>>>>> 
>>>>>> In general, you cannot remove inferred statements - those are given by
>>>>>> data + rules.
>>>>>> 
>>>>>> Indeed, you can remove statements on a materialized inferred model,
>> but
>>>>>> implicitly the class assertion does still exist.
>>>>>> 
>>>>>> 
>>>>>> On 15.02.2017 13:11, tina sani wrote:
>>>>>>> For example, I have added some classes for an individual using rules.
>>>>>>> emplyee 1 is type of Manager, Programmer, Worker.
>>>>>>> 
>>>>>>> Can I replace these classes with one class like
>>>>>>> if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
>>>>>>> (emp1.hasOntClass(worker)  then emp1 should be type of one class
>>>>> Employee
>>>>>>> and replace/remove these three classes.?
>>>>>>> 
>>>>>>> There is one method, I dont know if it is suitable here to apply?
>>>>>>> 
>>>>>>> Individual.removeOntClass(Resource)
>>>>>>> <https://jena.apache.org/documentation/javadoc/jena/
>>>>>> org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
>>>>>> jena.rdf.model.Resource->
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>> 
>> 


Re: Remove class

Posted by tina sani <ti...@gmail.com>.
yes,

On Wed, Feb 15, 2017 at 4:55 PM, A. Soroka <aj...@virginia.edu> wrote:

> Can you tell us something about this project? Is this a school assignment?
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Feb 15, 2017, at 8:54 AM, tina sani <ti...@gmail.com> wrote:
> >
> > Lorenz, using rules in my project is mandatory part so need to stick with
> > it.
> >
> > On Wed, Feb 15, 2017 at 4:50 PM, Chris Dollin <
> chris.dollin@epimorphics.com>
> > wrote:
> >
> >> On 15 February 2017 at 13:06, tina sani <ti...@gmail.com> wrote:
> >>
> >>> Hello Lorenz, so no way to remove or replace these classes?
> >>> setOntClass also not working, I have tried it.
> >>>
> >>
> >> If you don't want inference to add back the statements
> >> you have deleted
> >>
> >> Then don't use inference to add the statements in
> >> the first place
> >>
> >> Then you can add and remove statements as you like
> >>
> >> Chris
> >>
> >>
> >>> On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
> >>> buehmann@informatik.uni-leipzig.de> wrote:
> >>>
> >>>> In general, you cannot remove inferred statements - those are given by
> >>>> data + rules.
> >>>>
> >>>> Indeed, you can remove statements on a materialized inferred model,
> but
> >>>> implicitly the class assertion does still exist.
> >>>>
> >>>>
> >>>> On 15.02.2017 13:11, tina sani wrote:
> >>>>> For example, I have added some classes for an individual using rules.
> >>>>> emplyee 1 is type of Manager, Programmer, Worker.
> >>>>>
> >>>>> Can I replace these classes with one class like
> >>>>> if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
> >>>>> (emp1.hasOntClass(worker)  then emp1 should be type of one class
> >>> Employee
> >>>>> and replace/remove these three classes.?
> >>>>>
> >>>>> There is one method, I dont know if it is suitable here to apply?
> >>>>>
> >>>>> Individual.removeOntClass(Resource)
> >>>>> <https://jena.apache.org/documentation/javadoc/jena/
> >>>> org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
> >>>> jena.rdf.model.Resource->
> >>>>>
> >>>>
> >>>>
> >>>
> >>
>
>

Re: Remove class

Posted by "A. Soroka" <aj...@virginia.edu>.
Can you tell us something about this project? Is this a school assignment?

---
A. Soroka
The University of Virginia Library

> On Feb 15, 2017, at 8:54 AM, tina sani <ti...@gmail.com> wrote:
> 
> Lorenz, using rules in my project is mandatory part so need to stick with
> it.
> 
> On Wed, Feb 15, 2017 at 4:50 PM, Chris Dollin <ch...@epimorphics.com>
> wrote:
> 
>> On 15 February 2017 at 13:06, tina sani <ti...@gmail.com> wrote:
>> 
>>> Hello Lorenz, so no way to remove or replace these classes?
>>> setOntClass also not working, I have tried it.
>>> 
>> 
>> If you don't want inference to add back the statements
>> you have deleted
>> 
>> Then don't use inference to add the statements in
>> the first place
>> 
>> Then you can add and remove statements as you like
>> 
>> Chris
>> 
>> 
>>> On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
>>> buehmann@informatik.uni-leipzig.de> wrote:
>>> 
>>>> In general, you cannot remove inferred statements - those are given by
>>>> data + rules.
>>>> 
>>>> Indeed, you can remove statements on a materialized inferred model, but
>>>> implicitly the class assertion does still exist.
>>>> 
>>>> 
>>>> On 15.02.2017 13:11, tina sani wrote:
>>>>> For example, I have added some classes for an individual using rules.
>>>>> emplyee 1 is type of Manager, Programmer, Worker.
>>>>> 
>>>>> Can I replace these classes with one class like
>>>>> if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
>>>>> (emp1.hasOntClass(worker)  then emp1 should be type of one class
>>> Employee
>>>>> and replace/remove these three classes.?
>>>>> 
>>>>> There is one method, I dont know if it is suitable here to apply?
>>>>> 
>>>>> Individual.removeOntClass(Resource)
>>>>> <https://jena.apache.org/documentation/javadoc/jena/
>>>> org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
>>>> jena.rdf.model.Resource->
>>>>> 
>>>> 
>>>> 
>>> 
>> 


Re: Remove class

Posted by tina sani <ti...@gmail.com>.
Lorenz, using rules in my project is mandatory part so need to stick with
it.

On Wed, Feb 15, 2017 at 4:50 PM, Chris Dollin <ch...@epimorphics.com>
wrote:

> On 15 February 2017 at 13:06, tina sani <ti...@gmail.com> wrote:
>
> > Hello Lorenz, so no way to remove or replace these classes?
> > setOntClass also not working, I have tried it.
> >
>
> If you don't want inference to add back the statements
> you have deleted
>
> Then don't use inference to add the statements in
> the first place
>
> Then you can add and remove statements as you like
>
> Chris
>
>
> > On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
> > buehmann@informatik.uni-leipzig.de> wrote:
> >
> > > In general, you cannot remove inferred statements - those are given by
> > > data + rules.
> > >
> > > Indeed, you can remove statements on a materialized inferred model, but
> > > implicitly the class assertion does still exist.
> > >
> > >
> > > On 15.02.2017 13:11, tina sani wrote:
> > > > For example, I have added some classes for an individual using rules.
> > > > emplyee 1 is type of Manager, Programmer, Worker.
> > > >
> > > > Can I replace these classes with one class like
> > > > if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
> > > > (emp1.hasOntClass(worker)  then emp1 should be type of one class
> > Employee
> > > > and replace/remove these three classes.?
> > > >
> > > > There is one method, I dont know if it is suitable here to apply?
> > > >
> > > > Individual.removeOntClass(Resource)
> > > > <https://jena.apache.org/documentation/javadoc/jena/
> > > org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
> > > jena.rdf.model.Resource->
> > > >
> > >
> > >
> >
>

Re: Remove class

Posted by Chris Dollin <ch...@epimorphics.com>.
On 15 February 2017 at 13:06, tina sani <ti...@gmail.com> wrote:

> Hello Lorenz, so no way to remove or replace these classes?
> setOntClass also not working, I have tried it.
>

If you don't want inference to add back the statements
you have deleted

Then don't use inference to add the statements in
the first place

Then you can add and remove statements as you like

Chris


> On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
> buehmann@informatik.uni-leipzig.de> wrote:
>
> > In general, you cannot remove inferred statements - those are given by
> > data + rules.
> >
> > Indeed, you can remove statements on a materialized inferred model, but
> > implicitly the class assertion does still exist.
> >
> >
> > On 15.02.2017 13:11, tina sani wrote:
> > > For example, I have added some classes for an individual using rules.
> > > emplyee 1 is type of Manager, Programmer, Worker.
> > >
> > > Can I replace these classes with one class like
> > > if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
> > > (emp1.hasOntClass(worker)  then emp1 should be type of one class
> Employee
> > > and replace/remove these three classes.?
> > >
> > > There is one method, I dont know if it is suitable here to apply?
> > >
> > > Individual.removeOntClass(Resource)
> > > <https://jena.apache.org/documentation/javadoc/jena/
> > org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
> > jena.rdf.model.Resource->
> > >
> >
> >
>

Re: Remove class

Posted by tina sani <ti...@gmail.com>.
Hello Lorenz, should we add inferred model to default like this?


//m is an empty default model and infmodel is inference model
m.add(infmodel);

On Thu, Feb 16, 2017 at 11:29 AM, Lorenz B. <
buehmann@informatik.uni-leipzig.de> wrote:

> Put the inferred model in a default model
>
> > *materialize the model M1 to M2
> >
> > Lorenz, I do not understand it. How to materialize model 1 to 2.?
> >
> > On Wed, Feb 15, 2017 at 6:08 PM, Lorenz Buehmann <
> > buehmann@informatik.uni-leipzig.de> wrote:
> >
> >> As I said, materialize the model M1 to M2 and then you can change the
> >> triples in M2. But understand, if you run the inferencing step again,
> >> the "old" classes will be added in addition to what you added manually.
> >>
> >>
> >> On 15.02.2017 14:06, tina sani wrote:
> >>> Hello Lorenz, so no way to remove or replace these classes?
> >>> setOntClass also not working, I have tried it.
> >>>
> >>>
> >>> On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
> >>> buehmann@informatik.uni-leipzig.de> wrote:
> >>>
> >>>> In general, you cannot remove inferred statements - those are given by
> >>>> data + rules.
> >>>>
> >>>> Indeed, you can remove statements on a materialized inferred model,
> but
> >>>> implicitly the class assertion does still exist.
> >>>>
> >>>>
> >>>> On 15.02.2017 13:11, tina sani wrote:
> >>>>> For example, I have added some classes for an individual using rules.
> >>>>> emplyee 1 is type of Manager, Programmer, Worker.
> >>>>>
> >>>>> Can I replace these classes with one class like
> >>>>> if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
> >>>>> (emp1.hasOntClass(worker)  then emp1 should be type of one class
> >> Employee
> >>>>> and replace/remove these three classes.?
> >>>>>
> >>>>> There is one method, I dont know if it is suitable here to apply?
> >>>>>
> >>>>> Individual.removeOntClass(Resource)
> >>>>> <https://jena.apache.org/documentation/javadoc/jena/
> >>>> org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
> >>>> jena.rdf.model.Resource->
> >>>>
> >>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>

Re: Remove class

Posted by "Lorenz B." <bu...@informatik.uni-leipzig.de>.
Put the inferred model in a default model

> *materialize the model M1 to M2
>
> Lorenz, I do not understand it. How to materialize model 1 to 2.?
>
> On Wed, Feb 15, 2017 at 6:08 PM, Lorenz Buehmann <
> buehmann@informatik.uni-leipzig.de> wrote:
>
>> As I said, materialize the model M1 to M2 and then you can change the
>> triples in M2. But understand, if you run the inferencing step again,
>> the "old" classes will be added in addition to what you added manually.
>>
>>
>> On 15.02.2017 14:06, tina sani wrote:
>>> Hello Lorenz, so no way to remove or replace these classes?
>>> setOntClass also not working, I have tried it.
>>>
>>>
>>> On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
>>> buehmann@informatik.uni-leipzig.de> wrote:
>>>
>>>> In general, you cannot remove inferred statements - those are given by
>>>> data + rules.
>>>>
>>>> Indeed, you can remove statements on a materialized inferred model, but
>>>> implicitly the class assertion does still exist.
>>>>
>>>>
>>>> On 15.02.2017 13:11, tina sani wrote:
>>>>> For example, I have added some classes for an individual using rules.
>>>>> emplyee 1 is type of Manager, Programmer, Worker.
>>>>>
>>>>> Can I replace these classes with one class like
>>>>> if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
>>>>> (emp1.hasOntClass(worker)  then emp1 should be type of one class
>> Employee
>>>>> and replace/remove these three classes.?
>>>>>
>>>>> There is one method, I dont know if it is suitable here to apply?
>>>>>
>>>>> Individual.removeOntClass(Resource)
>>>>> <https://jena.apache.org/documentation/javadoc/jena/
>>>> org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
>>>> jena.rdf.model.Resource->
>>>>
>>
-- 
Lorenz B�hmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center


Re: Remove class

Posted by tina sani <ti...@gmail.com>.
*materialize the model M1 to M2

Lorenz, I do not understand it. How to materialize model 1 to 2.?

On Wed, Feb 15, 2017 at 6:08 PM, Lorenz Buehmann <
buehmann@informatik.uni-leipzig.de> wrote:

> As I said, materialize the model M1 to M2 and then you can change the
> triples in M2. But understand, if you run the inferencing step again,
> the "old" classes will be added in addition to what you added manually.
>
>
> On 15.02.2017 14:06, tina sani wrote:
> > Hello Lorenz, so no way to remove or replace these classes?
> > setOntClass also not working, I have tried it.
> >
> >
> > On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
> > buehmann@informatik.uni-leipzig.de> wrote:
> >
> >> In general, you cannot remove inferred statements - those are given by
> >> data + rules.
> >>
> >> Indeed, you can remove statements on a materialized inferred model, but
> >> implicitly the class assertion does still exist.
> >>
> >>
> >> On 15.02.2017 13:11, tina sani wrote:
> >>> For example, I have added some classes for an individual using rules.
> >>> emplyee 1 is type of Manager, Programmer, Worker.
> >>>
> >>> Can I replace these classes with one class like
> >>> if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
> >>> (emp1.hasOntClass(worker)  then emp1 should be type of one class
> Employee
> >>> and replace/remove these three classes.?
> >>>
> >>> There is one method, I dont know if it is suitable here to apply?
> >>>
> >>> Individual.removeOntClass(Resource)
> >>> <https://jena.apache.org/documentation/javadoc/jena/
> >> org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
> >> jena.rdf.model.Resource->
> >>
>
>

Re: Remove class

Posted by Lorenz Buehmann <bu...@informatik.uni-leipzig.de>.
As I said, materialize the model M1 to M2 and then you can change the
triples in M2. But understand, if you run the inferencing step again,
the "old" classes will be added in addition to what you added manually.


On 15.02.2017 14:06, tina sani wrote:
> Hello Lorenz, so no way to remove or replace these classes?
> setOntClass also not working, I have tried it.
>
>
> On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
> buehmann@informatik.uni-leipzig.de> wrote:
>
>> In general, you cannot remove inferred statements - those are given by
>> data + rules.
>>
>> Indeed, you can remove statements on a materialized inferred model, but
>> implicitly the class assertion does still exist.
>>
>>
>> On 15.02.2017 13:11, tina sani wrote:
>>> For example, I have added some classes for an individual using rules.
>>> emplyee 1 is type of Manager, Programmer, Worker.
>>>
>>> Can I replace these classes with one class like
>>> if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
>>> (emp1.hasOntClass(worker)  then emp1 should be type of one class Employee
>>> and replace/remove these three classes.?
>>>
>>> There is one method, I dont know if it is suitable here to apply?
>>>
>>> Individual.removeOntClass(Resource)
>>> <https://jena.apache.org/documentation/javadoc/jena/
>> org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
>> jena.rdf.model.Resource->
>>


Re: Remove class

Posted by tina sani <ti...@gmail.com>.
Hello Lorenz, so no way to remove or replace these classes?
setOntClass also not working, I have tried it.


On Wed, Feb 15, 2017 at 3:50 PM, Lorenz Buehmann <
buehmann@informatik.uni-leipzig.de> wrote:

> In general, you cannot remove inferred statements - those are given by
> data + rules.
>
> Indeed, you can remove statements on a materialized inferred model, but
> implicitly the class assertion does still exist.
>
>
> On 15.02.2017 13:11, tina sani wrote:
> > For example, I have added some classes for an individual using rules.
> > emplyee 1 is type of Manager, Programmer, Worker.
> >
> > Can I replace these classes with one class like
> > if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
> > (emp1.hasOntClass(worker)  then emp1 should be type of one class Employee
> > and replace/remove these three classes.?
> >
> > There is one method, I dont know if it is suitable here to apply?
> >
> > Individual.removeOntClass(Resource)
> > <https://jena.apache.org/documentation/javadoc/jena/
> org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.
> jena.rdf.model.Resource->
> >
>
>

Re: Remove class

Posted by Lorenz Buehmann <bu...@informatik.uni-leipzig.de>.
In general, you cannot remove inferred statements - those are given by
data + rules.

Indeed, you can remove statements on a materialized inferred model, but
implicitly the class assertion does still exist.


On 15.02.2017 13:11, tina sani wrote:
> For example, I have added some classes for an individual using rules.
> emplyee 1 is type of Manager, Programmer, Worker.
>
> Can I replace these classes with one class like
> if (empl1.hasOntclass(manager) && (emp1.hasOntClass(programmer) &
> (emp1.hasOntClass(worker)  then emp1 should be type of one class Employee
> and replace/remove these three classes.?
>
> There is one method, I dont know if it is suitable here to apply?
>
> Individual.removeOntClass(Resource)
> <https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/ontology/Individual.html#removeOntClass-org.apache.jena.rdf.model.Resource->
>