Questions about functions in Jena ARQ

2014-03-19 Thread ????
Hello ,everyone :
   I am a student .My name is Li Zhiguo. Now I am studing about Jena 
ARQ. Now I have two questions.
   Question one:   As you know ,there are two reorder functions in ARQ 
,one is default function ReorderFixed ,and another is ReorderWeighted. What's 
the differences bettween   them? 


   Question two:  Once I read a document , it says " The ResultSet 
class is a container to a Filter chain ". What's is a " Filter chain"  on 
earth?  or  How does  the "Filter chain"  works ?


   
   Thanks to everyone for your help !

Re: Jena + pellet Reasoner

2014-03-19 Thread Adeeb Noor
will do, thanks



On Wed, Mar 19, 2014 at 12:30 PM, Dave Reynolds
wrote:

> On 19/03/14 18:04, Adeeb Noor wrote:
>
>> Thanks Dave
>>
>> I am using protoge 4.2.0. I created the class sameKEGG and the
>> object property ddids:x-kegg.pathway; but I am not able to find the
>> hasValue restriction. any idea ?
>>
>
> Sorry no. Last time I used protege was a long time ago and then it was
> pretty obvious ("create restriction", select "hasValue" and fill in the
> form). If it's no longer obvious then you'll need to ask on a protege list.
>
> Dave
>
>
>
>> On Wed, Mar 19, 2014 at 11:33 AM, Dave Reynolds
>> wrote:
>>
>>  On 19/03/14 17:26, Adeeb Noor wrote:
>>>
>>>  Hi Dave:

 Thanks for your answer.

owl:onProperty ddids:x-kegg.pathway;
   owl:hasValue 
 ] .

 What data type should I give to hasValue object property to accept the
 URI.


>>> No data type,  is a
>>> resource not a literal.
>>>
>>> Dave
>>>
>>>
>>>   thanks
>>>


 On Mon, Mar 17, 2014 at 4:28 AM, Dave Reynolds <
 dave.e.reyno...@gmail.com

> wrote:
>

   On 14/03/14 08:08, Adeeb Noor wrote:

>
>   Hello everyone:
>
>>
>> I have been struggling a lot with a problem that I did not find a
>> solution
>> for, so hopefully guys can guide me or help me with it.
>>
>> I have my data (rdfs) store in jena tdb as model and my owl (schema)
>> using
>> protoge.
>>
>> Here is the code to merge data and schema:
>>
>> System.out.println("creting infeer dataset ");
>>Dataset dataset = TDBFactory.createDataset(data.
>> infereedTDB);
>>
>>System.out.println("creting OntModel ");
>>OntModel Infmodel =
>> ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC,
>> dataset.getNamedModel(this.URL));
>>
>>System.out.println("adding schema (OWL) to OntModel");
>>Infmodel.add(this.owl);
>>
>>System.out.println("adding data (RDF) to OntModel ");
>>Infmodel.add(data.tdb);
>>
>>System.out.println("creting ModelExtractor ");
>>ModelExtractor ext = new ModelExtractor(Infmodel);
>>
>>dataset.replaceNamedModel(this.URL, ext.extractModel());
>>
>>System.out.println("saving infead model");
>>Infmodel.close();
>>System.out.println("closing infeed dataset");
>>dataset.close();
>>
>>
>>  Unless something has changed then Pellet is an in-memory reasoner so
> reasoning directly over the TDB data doesn't necessarily enable you to
> scale beyond memory sized data and may be a performance hit.
>
>
>So I have the ability to store my inferred data into new tdb and to
> reason
>
>  or build any rule based on Literal values . For example: this is one
>> triple
>> that has UMLS_type as a property and I can group all subjects with two
>> or
>> more UMLS_types for instance.
>>
>>
>>  Not sure what you mean by "grouping" here. This is not one triple
> but one
> resource which is the subject of a number of triples.
>
>
>   ddidd:C0007586 | ddids:label
>
>>   | "Cell Cycle"
>> ddidd:C0007586 |  |
>> ddids:Pathway
>> ddidd:C0007586 | ddids:UMLS_type
>>   | "T043"
>> ddidd:C0007586 |
>> ddids:x-kegg.pathway
>> | <
>> http://identifiers.org/kegg.pathway/hsa04110>
>>
>>
>>
>However, as you can see from the triple above I have x-kegg.pathway
>   as an
>
>  external uri. By default protoge takes it to be object property. What
>> I
>> cannot do is to write a rule for example to group all subject under
>> same
>> x-kegg.pathway number since it is external URI.
>>
>>
>>  What you do you mean by "group"?
>
> What do you mean by rule here?  Swrl rules?  If so then you need to ask
> the Pellet folks for support on that.
>
> Why is the URI being "external" of any relevance here?  Normally that
> wouldn't matter at all.
>
>
> For example, I want to
>
>  create a class called sameKEGG that its members has <
>> http://identifiers.org/kegg.pathway/hsa04110>  value for example.
>>
>>
>>  That you could do directly in OWL, no need for rules, something like:
>
> eg:sameKEGG a owl:Class;
>   owl:equivalentClass  [
>   a owl:Restriction;
>   owl:onProperty ddids:x-kegg.pathway;
>   owl:hasValue 
> ] .
>
> Dave
>
>
>
>


>>>
>>
>>
>


-- 
Adeeb Noor
P

Re: Jena + pellet Reasoner

2014-03-19 Thread Dave Reynolds

On 19/03/14 18:04, Adeeb Noor wrote:

Thanks Dave

I am using protoge 4.2.0. I created the class sameKEGG and the
object property ddids:x-kegg.pathway; but I am not able to find the
hasValue restriction. any idea ?


Sorry no. Last time I used protege was a long time ago and then it was 
pretty obvious ("create restriction", select "hasValue" and fill in the 
form). If it's no longer obvious then you'll need to ask on a protege list.


Dave



On Wed, Mar 19, 2014 at 11:33 AM, Dave Reynolds
wrote:


On 19/03/14 17:26, Adeeb Noor wrote:


Hi Dave:

Thanks for your answer.

   owl:onProperty ddids:x-kegg.pathway;
  owl:hasValue  ] .

What data type should I give to hasValue object property to accept the
URI.



No data type,  is a
resource not a literal.

Dave


  thanks



On Mon, Mar 17, 2014 at 4:28 AM, Dave Reynolds 
wrote:


  On 14/03/14 08:08, Adeeb Noor wrote:


  Hello everyone:


I have been struggling a lot with a problem that I did not find a
solution
for, so hopefully guys can guide me or help me with it.

I have my data (rdfs) store in jena tdb as model and my owl (schema)
using
protoge.

Here is the code to merge data and schema:

System.out.println("creting infeer dataset ");
   Dataset dataset = TDBFactory.createDataset(data.infereedTDB);

   System.out.println("creting OntModel ");
   OntModel Infmodel =
ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC,
dataset.getNamedModel(this.URL));

   System.out.println("adding schema (OWL) to OntModel");
   Infmodel.add(this.owl);

   System.out.println("adding data (RDF) to OntModel ");
   Infmodel.add(data.tdb);

   System.out.println("creting ModelExtractor ");
   ModelExtractor ext = new ModelExtractor(Infmodel);

   dataset.replaceNamedModel(this.URL, ext.extractModel());

   System.out.println("saving infead model");
   Infmodel.close();
   System.out.println("closing infeed dataset");
   dataset.close();



Unless something has changed then Pellet is an in-memory reasoner so
reasoning directly over the TDB data doesn't necessarily enable you to
scale beyond memory sized data and may be a performance hit.


   So I have the ability to store my inferred data into new tdb and to
reason


or build any rule based on Literal values . For example: this is one
triple
that has UMLS_type as a property and I can group all subjects with two
or
more UMLS_types for instance.



Not sure what you mean by "grouping" here. This is not one triple but one
resource which is the subject of a number of triples.


  ddidd:C0007586 | ddids:label

  | "Cell Cycle"
ddidd:C0007586 |  |
ddids:Pathway
ddidd:C0007586 | ddids:UMLS_type
  | "T043"
ddidd:C0007586 |
ddids:x-kegg.pathway | <
http://identifiers.org/kegg.pathway/hsa04110>




   However, as you can see from the triple above I have x-kegg.pathway
  as an


external uri. By default protoge takes it to be object property. What I
cannot do is to write a rule for example to group all subject under same
x-kegg.pathway number since it is external URI.



What you do you mean by "group"?

What do you mean by rule here?  Swrl rules?  If so then you need to ask
the Pellet folks for support on that.

Why is the URI being "external" of any relevance here?  Normally that
wouldn't matter at all.


For example, I want to


create a class called sameKEGG that its members has <
http://identifiers.org/kegg.pathway/hsa04110>  value for example.



That you could do directly in OWL, no need for rules, something like:

eg:sameKEGG a owl:Class;
  owl:equivalentClass  [
  a owl:Restriction;
  owl:onProperty ddids:x-kegg.pathway;
  owl:hasValue  ] .

Dave















Re: Jena + pellet Reasoner

2014-03-19 Thread Adeeb Noor
Thanks Dave

I am using protoge 4.2.0. I created the class sameKEGG and the
object property ddids:x-kegg.pathway; but I am not able to find the
hasValue restriction. any idea ?

Thanks




On Wed, Mar 19, 2014 at 11:33 AM, Dave Reynolds
wrote:

> On 19/03/14 17:26, Adeeb Noor wrote:
>
>> Hi Dave:
>>
>> Thanks for your answer.
>>
>>   owl:onProperty ddids:x-kegg.pathway;
>>  owl:hasValue  ] .
>>
>> What data type should I give to hasValue object property to accept the
>> URI.
>>
>
> No data type,  is a
> resource not a literal.
>
> Dave
>
>
>  thanks
>>
>>
>> On Mon, Mar 17, 2014 at 4:28 AM, Dave Reynolds > >wrote:
>>
>>  On 14/03/14 08:08, Adeeb Noor wrote:
>>>
>>>  Hello everyone:

 I have been struggling a lot with a problem that I did not find a
 solution
 for, so hopefully guys can guide me or help me with it.

 I have my data (rdfs) store in jena tdb as model and my owl (schema)
 using
 protoge.

 Here is the code to merge data and schema:

 System.out.println("creting infeer dataset ");
   Dataset dataset = TDBFactory.createDataset(data.infereedTDB);

   System.out.println("creting OntModel ");
   OntModel Infmodel =
 ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC,
 dataset.getNamedModel(this.URL));

   System.out.println("adding schema (OWL) to OntModel");
   Infmodel.add(this.owl);

   System.out.println("adding data (RDF) to OntModel ");
   Infmodel.add(data.tdb);

   System.out.println("creting ModelExtractor ");
   ModelExtractor ext = new ModelExtractor(Infmodel);

   dataset.replaceNamedModel(this.URL, ext.extractModel());

   System.out.println("saving infead model");
   Infmodel.close();
   System.out.println("closing infeed dataset");
   dataset.close();


>>> Unless something has changed then Pellet is an in-memory reasoner so
>>> reasoning directly over the TDB data doesn't necessarily enable you to
>>> scale beyond memory sized data and may be a performance hit.
>>>
>>>
>>>   So I have the ability to store my inferred data into new tdb and to
>>> reason
>>>
 or build any rule based on Literal values . For example: this is one
 triple
 that has UMLS_type as a property and I can group all subjects with two
 or
 more UMLS_types for instance.


>>> Not sure what you mean by "grouping" here. This is not one triple but one
>>> resource which is the subject of a number of triples.
>>>
>>>
>>>  ddidd:C0007586 | ddids:label
  | "Cell Cycle"
 ddidd:C0007586 |  |
 ddids:Pathway
 ddidd:C0007586 | ddids:UMLS_type
  | "T043"
 ddidd:C0007586 |
 ddids:x-kegg.pathway | <
 http://identifiers.org/kegg.pathway/hsa04110>


>>>
>>>   However, as you can see from the triple above I have x-kegg.pathway
>>>  as an
>>>
 external uri. By default protoge takes it to be object property. What I
 cannot do is to write a rule for example to group all subject under same
 x-kegg.pathway number since it is external URI.


>>> What you do you mean by "group"?
>>>
>>> What do you mean by rule here?  Swrl rules?  If so then you need to ask
>>> the Pellet folks for support on that.
>>>
>>> Why is the URI being "external" of any relevance here?  Normally that
>>> wouldn't matter at all.
>>>
>>>
>>>For example, I want to
>>>
 create a class called sameKEGG that its members has <
 http://identifiers.org/kegg.pathway/hsa04110>  value for example.


>>> That you could do directly in OWL, no need for rules, something like:
>>>
>>> eg:sameKEGG a owl:Class;
>>>  owl:equivalentClass  [
>>>  a owl:Restriction;
>>>  owl:onProperty ddids:x-kegg.pathway;
>>>  owl:hasValue  ] .
>>>
>>> Dave
>>>
>>>
>>>
>>
>>
>


-- 
Adeeb Noor
Ph.D. Candidate
Dept of Computer Science
University of Colorado at Boulder
Cell: 571-484-3303
Email: adeeb.n...@colorado.edu


Re: Removed RETERuleContext not fired to Builtin in rule head

2014-03-19 Thread Dave Reynolds

On 19/03/14 16:46, Christophe FAGOT wrote:

Hi Jena folks,

since I need to use Jena with its RETEEngine, I’m actually investigating what 
is actually feasible / usable with this engine functionalities.

I would like to develop my own BuiltIn, used in the head of a forward rule, and 
doing some actions when a new rule context appears (due to triples adding) for 
the body rule, while doing some other actions when a rule context disappears 
(dur to triples removal) for this body rule.

It appears in the RETEConflictSet (line 180) that a BuiltIn can receive only … 
added RETERuleContext. Hence a BuiltIn action can only be called when a 
RETERuleContext is added, never when a RETERuleContext is removed.

Is their a reason for that ?


The existing head builtins expect to only be fired when a potitive 
deduction is made. This is a legacy of the fact that the rule system was 
designed for monotonic inference and all the remove/non-monotonic 
processing is a hack. It was added due to requests on the user's list 
but was a mistake.


Note also that since there's no reference counting in the rule system 
it's notion of removal is not reliable.



Would it be possible to add in the context whether it’s a context added or 
removed, and to call the BuiltIn head action in both cases ?


No because that would change behaviour for existing rules sets, 
especially any with custom builtins.


I guess you could have a custom sort of builtin which does support 
firing a head-action on a remove and modify RETEConflictSet to check for 
such builtins and allow those (and only those) to fire - passing the 
isAdd flag as part of the call.


Dave



Re: Jena + pellet Reasoner

2014-03-19 Thread Adeeb Noor
Hi Dave:

Thanks for your answer.

 owl:onProperty ddids:x-kegg.pathway;
owl:hasValue  ] .

What data type should I give to hasValue object property to accept the URI.

thanks


On Mon, Mar 17, 2014 at 4:28 AM, Dave Reynolds wrote:

> On 14/03/14 08:08, Adeeb Noor wrote:
>
>> Hello everyone:
>>
>> I have been struggling a lot with a problem that I did not find a solution
>> for, so hopefully guys can guide me or help me with it.
>>
>> I have my data (rdfs) store in jena tdb as model and my owl (schema) using
>> protoge.
>>
>> Here is the code to merge data and schema:
>>
>> System.out.println("creting infeer dataset ");
>>  Dataset dataset = TDBFactory.createDataset(data.infereedTDB);
>>
>>  System.out.println("creting OntModel ");
>>  OntModel Infmodel =
>> ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC,
>> dataset.getNamedModel(this.URL));
>>
>>  System.out.println("adding schema (OWL) to OntModel");
>>  Infmodel.add(this.owl);
>>
>>  System.out.println("adding data (RDF) to OntModel ");
>>  Infmodel.add(data.tdb);
>>
>>  System.out.println("creting ModelExtractor ");
>>  ModelExtractor ext = new ModelExtractor(Infmodel);
>>
>>  dataset.replaceNamedModel(this.URL, ext.extractModel());
>>
>>  System.out.println("saving infead model");
>>  Infmodel.close();
>>  System.out.println("closing infeed dataset");
>>  dataset.close();
>>
>
> Unless something has changed then Pellet is an in-memory reasoner so
> reasoning directly over the TDB data doesn't necessarily enable you to
> scale beyond memory sized data and may be a performance hit.
>
>
>  So I have the ability to store my inferred data into new tdb and to reason
>> or build any rule based on Literal values . For example: this is one
>> triple
>> that has UMLS_type as a property and I can group all subjects with two or
>> more UMLS_types for instance.
>>
>
> Not sure what you mean by "grouping" here. This is not one triple but one
> resource which is the subject of a number of triples.
>
>
>> ddidd:C0007586 | ddids:label
>> | "Cell Cycle"
>> ddidd:C0007586 |  |
>> ddids:Pathway
>> ddidd:C0007586 | ddids:UMLS_type
>> | "T043"
>> ddidd:C0007586 |
>> ddids:x-kegg.pathway | <
>> http://identifiers.org/kegg.pathway/hsa04110>
>>
>
>
>  However, as you can see from the triple above I have x-kegg.pathway  as an
>> external uri. By default protoge takes it to be object property. What I
>> cannot do is to write a rule for example to group all subject under same
>> x-kegg.pathway number since it is external URI.
>>
>
> What you do you mean by "group"?
>
> What do you mean by rule here?  Swrl rules?  If so then you need to ask
> the Pellet folks for support on that.
>
> Why is the URI being "external" of any relevance here?  Normally that
> wouldn't matter at all.
>
>
>   For example, I want to
>> create a class called sameKEGG that its members has <
>> http://identifiers.org/kegg.pathway/hsa04110>  value for example.
>>
>
> That you could do directly in OWL, no need for rules, something like:
>
> eg:sameKEGG a owl:Class;
> owl:equivalentClass  [
> a owl:Restriction;
> owl:onProperty ddids:x-kegg.pathway;
> owl:hasValue  ] .
>
> Dave
>
>


-- 
Adeeb Noor
Ph.D. Candidate
Dept of Computer Science
University of Colorado at Boulder
Cell: 571-484-3303
Email: adeeb.n...@colorado.edu


Re: Jena + pellet Reasoner

2014-03-19 Thread Dave Reynolds

On 19/03/14 17:26, Adeeb Noor wrote:

Hi Dave:

Thanks for your answer.

  owl:onProperty ddids:x-kegg.pathway;
 owl:hasValue  ] .

What data type should I give to hasValue object property to accept the URI.


No data type,  is a 
resource not a literal.


Dave


thanks


On Mon, Mar 17, 2014 at 4:28 AM, Dave Reynolds wrote:


On 14/03/14 08:08, Adeeb Noor wrote:


Hello everyone:

I have been struggling a lot with a problem that I did not find a solution
for, so hopefully guys can guide me or help me with it.

I have my data (rdfs) store in jena tdb as model and my owl (schema) using
protoge.

Here is the code to merge data and schema:

System.out.println("creting infeer dataset ");
  Dataset dataset = TDBFactory.createDataset(data.infereedTDB);

  System.out.println("creting OntModel ");
  OntModel Infmodel =
ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC,
dataset.getNamedModel(this.URL));

  System.out.println("adding schema (OWL) to OntModel");
  Infmodel.add(this.owl);

  System.out.println("adding data (RDF) to OntModel ");
  Infmodel.add(data.tdb);

  System.out.println("creting ModelExtractor ");
  ModelExtractor ext = new ModelExtractor(Infmodel);

  dataset.replaceNamedModel(this.URL, ext.extractModel());

  System.out.println("saving infead model");
  Infmodel.close();
  System.out.println("closing infeed dataset");
  dataset.close();



Unless something has changed then Pellet is an in-memory reasoner so
reasoning directly over the TDB data doesn't necessarily enable you to
scale beyond memory sized data and may be a performance hit.


  So I have the ability to store my inferred data into new tdb and to reason

or build any rule based on Literal values . For example: this is one
triple
that has UMLS_type as a property and I can group all subjects with two or
more UMLS_types for instance.



Not sure what you mean by "grouping" here. This is not one triple but one
resource which is the subject of a number of triples.



ddidd:C0007586 | ddids:label
 | "Cell Cycle"
ddidd:C0007586 |  |
ddids:Pathway
ddidd:C0007586 | ddids:UMLS_type
 | "T043"
ddidd:C0007586 |
ddids:x-kegg.pathway | <
http://identifiers.org/kegg.pathway/hsa04110>




  However, as you can see from the triple above I have x-kegg.pathway  as an

external uri. By default protoge takes it to be object property. What I
cannot do is to write a rule for example to group all subject under same
x-kegg.pathway number since it is external URI.



What you do you mean by "group"?

What do you mean by rule here?  Swrl rules?  If so then you need to ask
the Pellet folks for support on that.

Why is the URI being "external" of any relevance here?  Normally that
wouldn't matter at all.


   For example, I want to

create a class called sameKEGG that its members has <
http://identifiers.org/kegg.pathway/hsa04110>  value for example.



That you could do directly in OWL, no need for rules, something like:

eg:sameKEGG a owl:Class;
 owl:equivalentClass  [
 a owl:Restriction;
 owl:onProperty ddids:x-kegg.pathway;
 owl:hasValue  ] .

Dave









Removed RETERuleContext not fired to Builtin in rule head

2014-03-19 Thread Christophe FAGOT
Hi Jena folks,

since I need to use Jena with its RETEEngine, I’m actually investigating what 
is actually feasible / usable with this engine functionalities.

I would like to develop my own BuiltIn, used in the head of a forward rule, and 
doing some actions when a new rule context appears (due to triples adding) for 
the body rule, while doing some other actions when a rule context disappears 
(dur to triples removal) for this body rule.

It appears in the RETEConflictSet (line 180) that a BuiltIn can receive only … 
added RETERuleContext. Hence a BuiltIn action can only be called when a 
RETERuleContext is added, never when a RETERuleContext is removed.

Is their a reason for that ?

Would it be possible to add in the context whether it’s a context added or 
removed, and to call the BuiltIn head action in both cases ?

Thanks,

Chris.


: : . . . . . . . . . . . . . . . . . . . . . . . : :
Christophe FAGOT, PhD
Responsable R&D informatique

intactile DESIGN
: : Création d’interfaces subtiles : :
+33 (0)4 67 52 88 61
+33 (0)9 50 12 05 66
20 rue du carré du roi
34000 MONTPELLIER,  France
http://www.intactile.com

Hugh MacLeod : "It's not what the software does, it's what the user does"

Les informations contenues dans cet email et ses documents attachés sont 
confidentielles. Elles sont exclusivement adressées aux destinataires 
explicitement désignés ci-dessus et ne peuvent être divulguées sans 
consentement de son auteur. Si vous n'êtes pas le destinataire de cet email 
vous ne devez pas employer, révéler, distribuer, copier, imprimer ou 
transmettre le contenu de cet email et devez le détruire immédiatement.