Re: fuseki in HA

2018-02-22 Thread DAVID MOLINA ESTRADA
Hi Andy,

In the next few days I will study your proposal and the diferents posibilities.


Thank you


  David Molina Estrada

  Software Architect

-Andy Seaborne  escribió: -
Para: users@jena.apache.org
De: Andy Seaborne 
Fecha: 22/02/2018 13:15
Asunto: [MASSMAIL]Re: fuseki in HA

Hi David,

This is one of the main use cases for:

https://afs.github.io/rdf-delta/

and there is a Fuseki-component in that build that incorporates the 
mechanism need for 2+ Fuseki's to propagate changes [3] (a custom 
service /dataset/patch that accepts patch files and applied them).

The work has two parts - the data format need to propagate change (RDF 
Patch [1]) and a patch log server [2].

Keeping these two components separate is import because not all 
situations will want patch server.  Distribution using  Hazelcast or 
Kafka, or publish changes in the style of Atom/RSS, being good examples. 
By having a defined patch format, there is no reason why the various 
triplestores even have to be all Jena-based.

Apache Licensed, not part of the Jena project.

Let me know what you think:

 Andy

[1] https://afs.github.io/rdf-delta/rdf-patch.html
[2] https://afs.github.io/rdf-delta/rdf-patch-logs.html
[3] https://github.com/afs/rdf-delta/tree/master/rdf-delta-fuseki

Disclosure : this part of my $job at TopQuadrant.

There is not reason not to start publishing it to maven central - I just 
haven't had the need to so far.

The RDF patch work is based on previous work with Rob Vesse.

On 21/02/18 12:32, DAVID MOLINA ESTRADA wrote:
> Hi,
> 
> I want to buid a HA web Application based on fuseki server in HA too. My idea 
> is create a fuseki docker and deploy so instance that I need. For querying 
> all is Ok, but I try to define a mechanism (it may be based in Topics with 
> Hazelcast or Kafka) to distribute changes to all nodes (Both uploading files 
> and SparQL updated).
> 
> Any recommandation or best practise? Has somebody done anything similar?
> 
> Thanks
> 
>   
> David Molina Estrada
> 
>
> Evite imprimir este mensaje si no es estrictamente necesario | Eviti imprimir 
> aquest missatge si no és estrictament necessari | Avoid printing this message 
> if it is not absolutely necessary
> 

Evite imprimir este mensaje si no es estrictamente necesario | Eviti imprimir 
aquest missatge si no és estrictament necessari | Avoid printing this message 
if it is not absolutely necessary



Re: Fuseki as Tomcat app: Setting FUSEKI_BASE

2018-02-22 Thread Lorenz Buehmann
What's the reason for using Fuseki 2.3 which is from 2015-07-29 ? The
latest version is 3.6.0


On 22.02.2018 17:57, Christian Schwaderer wrote:
> Dear all,
>
> my question might be stupid and rather basic, but I cannot find an answer 
> anywhere.
>
>
> So, I set up Fuseki 2.3 as a Tomcat 7 Web app. However, I cannot start it, 
> since
>
> "org.apache.jena.fuseki.FusekiConfigException: FUSEKI_BASE is not writable: 
> /etc/fuseki"
>
>
> I now want to change FUSEKI_BASE to a different directoy - where I can safely 
> change permissions (what I would consider a bad idea for /etc...).
>
>
> But I have no idea where and how to do that.
>
>
> Thanks in advance and best,
>
> Christian
>
>



Re: Fuseki as Tomcat app: Setting FUSEKI_BASE

2018-02-22 Thread Eric Boisvert
I ran in the very same problem (Tomcat running as a service on Windows -
which I assume is your case)

this is what I had to do

https://stackoverflow.com/questions/40456863/setting-user-environment-variables-for-tomcat-on-windows

while on the console you must use

tomcat8 //US//YourServiceName ++Environment varname=value





2018-02-22 15:15 GMT-05:00 Chris Tomlinson :

> Hi Christian,
>
> Are you sure that the FUSEKI_BASE is defined in the environment when
> tomcat is run? If you’re running tomcat as a service on Linux, for example,
> then you would need to add the export to the service or systemd definition
> that is used to run tomcat.
>
> Chris
>
> > On Feb 22, 2018, at 12:26 PM, Christian Schwaderer <
> c_schwade...@hotmail.com> wrote:
> >
> > Hi Chris,
> >
> >
> > thanks for that hint. However, it didn't work for me. Even after
> rebooting the system, the error is still the same: 
> "org.apache.jena.fuseki.FusekiConfigException:
> FUSEKI_BASE is not writable: /etc/fuseki"
> >
> > However,
> >
> > echo $FUSEKI_BASE
> >
> > gives me the changed directory.
> >
> >
> > Best,
> >
> > Christian
> >
> >
> >
> > 
> > Von: Chris Tomlinson 
> > Gesendet: Donnerstag, 22. Februar 2018 17:45
> > An: users@jena.apache.org
> > Betreff: Re: Fuseki as Tomcat app: Setting FUSEKI_BASE
> >
> > Hi Christian,
> >
> > You will need to ensure that FUSEKI_BASE is defined in the environment
> the tomcat is run in, like:
> >
> >export FUSEKI_BASE=/usr/local/fuseki/base
> >
> > Chris
> >
> >
> >> On Feb 22, 2018, at 10:57 AM, Christian Schwaderer <
> c_schwade...@hotmail.com> wrote:
> >>
> >> Dear all,
> >>
> >> my question might be stupid and rather basic, but I cannot find an
> answer anywhere.
> >>
> >>
> >> So, I set up Fuseki 2.3 as a Tomcat 7 Web app. However, I cannot start
> it, since
> >>
> >> "org.apache.jena.fuseki.FusekiConfigException: FUSEKI_BASE is not
> writable: /etc/fuseki"
> >>
> >>
> >> I now want to change FUSEKI_BASE to a different directoy - where I can
> safely change permissions (what I would consider a bad idea for /etc...).
> >>
> >>
> >> But I have no idea where and how to do that.
> >>
> >>
> >> Thanks in advance and best,
> >>
> >> Christian
> >>
> >
>
>


Re: Fuseki as Tomcat app: Setting FUSEKI_BASE

2018-02-22 Thread Chris Tomlinson
Hi Christian,

Are you sure that the FUSEKI_BASE is defined in the environment when tomcat is 
run? If you’re running tomcat as a service on Linux, for example, then you 
would need to add the export to the service or systemd definition that is used 
to run tomcat.

Chris

> On Feb 22, 2018, at 12:26 PM, Christian Schwaderer  
> wrote:
> 
> Hi Chris,
> 
> 
> thanks for that hint. However, it didn't work for me. Even after rebooting 
> the system, the error is still the same: 
> "org.apache.jena.fuseki.FusekiConfigException: FUSEKI_BASE is not writable: 
> /etc/fuseki"
> 
> However,
> 
> echo $FUSEKI_BASE
> 
> gives me the changed directory.
> 
> 
> Best,
> 
> Christian
> 
> 
> 
> 
> Von: Chris Tomlinson 
> Gesendet: Donnerstag, 22. Februar 2018 17:45
> An: users@jena.apache.org
> Betreff: Re: Fuseki as Tomcat app: Setting FUSEKI_BASE
> 
> Hi Christian,
> 
> You will need to ensure that FUSEKI_BASE is defined in the environment the 
> tomcat is run in, like:
> 
>export FUSEKI_BASE=/usr/local/fuseki/base
> 
> Chris
> 
> 
>> On Feb 22, 2018, at 10:57 AM, Christian Schwaderer 
>>  wrote:
>> 
>> Dear all,
>> 
>> my question might be stupid and rather basic, but I cannot find an answer 
>> anywhere.
>> 
>> 
>> So, I set up Fuseki 2.3 as a Tomcat 7 Web app. However, I cannot start it, 
>> since
>> 
>> "org.apache.jena.fuseki.FusekiConfigException: FUSEKI_BASE is not writable: 
>> /etc/fuseki"
>> 
>> 
>> I now want to change FUSEKI_BASE to a different directoy - where I can 
>> safely change permissions (what I would consider a bad idea for /etc...).
>> 
>> 
>> But I have no idea where and how to do that.
>> 
>> 
>> Thanks in advance and best,
>> 
>> Christian
>> 
> 



AW: Fuseki as Tomcat app: Setting FUSEKI_BASE

2018-02-22 Thread Christian Schwaderer
Hi Chris,


thanks for that hint. However, it didn't work for me. Even after rebooting the 
system, the error is still the same: 
"org.apache.jena.fuseki.FusekiConfigException: FUSEKI_BASE is not writable: 
/etc/fuseki"

However,

echo $FUSEKI_BASE

gives me the changed directory.


Best,

Christian




Von: Chris Tomlinson 
Gesendet: Donnerstag, 22. Februar 2018 17:45
An: users@jena.apache.org
Betreff: Re: Fuseki as Tomcat app: Setting FUSEKI_BASE

Hi Christian,

You will need to ensure that FUSEKI_BASE is defined in the environment the 
tomcat is run in, like:

export FUSEKI_BASE=/usr/local/fuseki/base

Chris


> On Feb 22, 2018, at 10:57 AM, Christian Schwaderer  
> wrote:
>
> Dear all,
>
> my question might be stupid and rather basic, but I cannot find an answer 
> anywhere.
>
>
> So, I set up Fuseki 2.3 as a Tomcat 7 Web app. However, I cannot start it, 
> since
>
> "org.apache.jena.fuseki.FusekiConfigException: FUSEKI_BASE is not writable: 
> /etc/fuseki"
>
>
> I now want to change FUSEKI_BASE to a different directoy - where I can safely 
> change permissions (what I would consider a bad idea for /etc...).
>
>
> But I have no idea where and how to do that.
>
>
> Thanks in advance and best,
>
> Christian
>



Re: Fuseki as Tomcat app: Setting FUSEKI_BASE

2018-02-22 Thread Chris Tomlinson
Hi Christian,

You will need to ensure that FUSEKI_BASE is defined in the environment the 
tomcat is run in, like:

export FUSEKI_BASE=/usr/local/fuseki/base

Chris


> On Feb 22, 2018, at 10:57 AM, Christian Schwaderer  
> wrote:
> 
> Dear all,
> 
> my question might be stupid and rather basic, but I cannot find an answer 
> anywhere.
> 
> 
> So, I set up Fuseki 2.3 as a Tomcat 7 Web app. However, I cannot start it, 
> since
> 
> "org.apache.jena.fuseki.FusekiConfigException: FUSEKI_BASE is not writable: 
> /etc/fuseki"
> 
> 
> I now want to change FUSEKI_BASE to a different directoy - where I can safely 
> change permissions (what I would consider a bad idea for /etc...).
> 
> 
> But I have no idea where and how to do that.
> 
> 
> Thanks in advance and best,
> 
> Christian
> 



Fuseki as Tomcat app: Setting FUSEKI_BASE

2018-02-22 Thread Christian Schwaderer
Dear all,

my question might be stupid and rather basic, but I cannot find an answer 
anywhere.


So, I set up Fuseki 2.3 as a Tomcat 7 Web app. However, I cannot start it, since

"org.apache.jena.fuseki.FusekiConfigException: FUSEKI_BASE is not writable: 
/etc/fuseki"


I now want to change FUSEKI_BASE to a different directoy - where I can safely 
change permissions (what I would consider a bad idea for /etc...).


But I have no idea where and how to do that.


Thanks in advance and best,

Christian



Re: Configuring fuseki with TDB2 and OWL reasoning

2018-02-22 Thread Eric Boisvert
this works (inferrence works). Note, I commented out ja:baseModel

---

<#model_inf> a ja:InfModel ;
 #ja:baseModel <#graph> ;
ja:content <#test-inf> ;
 ja:reasoner [
 ja:reasonerURL 
 ] .

<#graph> rdf:type tdb2:GraphTDB ;
  tdb2:dataset :datasetTDB2 .

 ## Storage
:datasetTDB2 rdf:type tdb2:DatasetTDB2 ;
tdb2:location "c:/fuseki/run/databases/gsip".

<#test-inf> ja:externalContent "c:\\fuseki/test.ttl" .

---



if I don't comment , I get this exception (which is expected I think)

[2018-02-22 09:09:47] Server ERROR Exception in initialization: the
loading of content into
file:///C:/fuseki/run/configuration/gsip.ttl#model_inf was abort
ed because of NodeTableThrift/Write
[2018-02-22 09:09:47] WebAppContext WARN  Failed startup of context
o.e.j.w.WebAppContext@8a62297{/,file:///C:/fuseki/webapp/,UNAVAILABLE}
org.apache.jena.assembler.exceptions.TransactionAbortedException: the
loading of content into
file:///C:/fuseki/run/configuration/gsip.ttl#model_inf was aborted
 because of NodeTableThrift/Write
  doing:
root: file:///C:/fuseki/run/configuration/gsip.ttl#model_inf with type:
http://jena.hpl.hp.com/2005/11/Assembler#InfModel assembler class: class
org.apache.
jena.assembler.assemblers.InfModelAssembler
root: http://base/#dataset with type:
http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset assembler class: class
org.apache.jena.sparql.core.assembler.Datas
etAssembler

at
org.apache.jena.assembler.assemblers.ModelAssembler.addContent(ModelAssembler.java:55)
at
org.apache.jena.assembler.assemblers.ModelAssembler.open(ModelAssembler.java:44)
at
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
at
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
at
org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
at
org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)






2018-02-20 5:59 GMT-05:00 Nouwt, B. (Barry) :

> Hi Eric,
>
> Another thing I noticed is that you said you were manually loading the
> data via the GUI after Apache Jena Fuseki has started. Maybe that data is
> not stored in the correct location (i.e. the baseModel of the InfModel) and
> there the reasoning fails?
>
> You could try to load the data on Apache Jena Fuseki startup automatically
> using a configuration like below (or is that no longer possible when using
> TDB2?):
>
> <#model_inf> a ja:InfModel ;
> ...
> ja:content <#test-inf> ;
> ...
>
> <#test-inf> ja:externalContent  .
>
> Regards, Barry
>
>
> -Original Message-
> From: Eric Boisvert [mailto:denevers1...@gmail.com]
> Sent: maandag 19 februari 2018 23:25
> To: users@jena.apache.org
> Subject: Re: Configuring fuseki with TDB2 and OWL reasoning
>
> made the change.
>
> Now I get
>
> Result: failed with message "Not in a transaction"
>
> when I try to load from the interface
>
>
> log:
>
> (...)
>
> [2018-02-19 17:21:31] Fuseki INFO  [5] Filename: test.ttl,
> Content-Type=appl
> ication/octet-stream, Charset=null => Turtle : Count=4 Triples=4 Quads=0
> [2018-02-19 17:21:31] Fuseki INFO  [5] 500 Not in a transaction (29 ms)
>
> Thank you very much helping me with this
>
> 2018-02-19 9:00 GMT-05:00 Andy Seaborne :
>
> >
> >
> > On 19/02/18 12:46, Eric Boisvert wrote:
> >
> >> :dataset a ja:RDFDataset ;
> >>  tdb2:defaultGraph   <#model_inf> .
> >> ## tdb2:location  "c:\\fuseki/run/databases/gsip".
> >>
> >>
> > ja:defaultGraph  not  tdb2:defaultGraph
> >
> > :dataset is a plain, in-memory dataset to hold the InfModel
> >
> > Andy
> >
> This message may contain information that is not intended for you. If you
> are not the addressee or if this message was sent to you by mistake, you
> are requested to inform the sender and delete the message. TNO accepts no
> liability for the content of this e-mail, for the manner in which you use
> it and for damage of any kind resulting from the risks inherent to the
> electronic transmission of messages.
>


Re: fuseki in HA

2018-02-22 Thread Andy Seaborne

Hi David,

This is one of the main use cases for:

https://afs.github.io/rdf-delta/

and there is a Fuseki-component in that build that incorporates the 
mechanism need for 2+ Fuseki's to propagate changes [3] (a custom 
service /dataset/patch that accepts patch files and applied them).


The work has two parts - the data format need to propagate change (RDF 
Patch [1]) and a patch log server [2].


Keeping these two components separate is import because not all 
situations will want patch server.  Distribution using  Hazelcast or 
Kafka, or publish changes in the style of Atom/RSS, being good examples. 
By having a defined patch format, there is no reason why the various 
triplestores even have to be all Jena-based.


Apache Licensed, not part of the Jena project.

Let me know what you think:

Andy

[1] https://afs.github.io/rdf-delta/rdf-patch.html
[2] https://afs.github.io/rdf-delta/rdf-patch-logs.html
[3] https://github.com/afs/rdf-delta/tree/master/rdf-delta-fuseki

Disclosure : this part of my $job at TopQuadrant.

There is not reason not to start publishing it to maven central - I just 
haven't had the need to so far.


The RDF patch work is based on previous work with Rob Vesse.

On 21/02/18 12:32, DAVID MOLINA ESTRADA wrote:

Hi,

I want to buid a HA web Application based on fuseki server in HA too. My idea 
is create a fuseki docker and deploy so instance that I need. For querying all 
is Ok, but I try to define a mechanism (it may be based in Topics with 
Hazelcast or Kafka) to distribute changes to all nodes (Both uploading files 
and SparQL updated).

Any recommandation or best practise? Has somebody done anything similar?

Thanks

  
David Molina Estrada


   
Evite imprimir este mensaje si no es estrictamente necesario | Eviti imprimir aquest missatge si no és estrictament necessari | Avoid printing this message if it is not absolutely necessary




Re: Validating TDB data via HTTP

2018-02-22 Thread Andy Seaborne

Digressing slightly ...

Fuseki (next release) will have the ability to add custom services
on datasets. Currently, its the fixed builtin set of query, update, 
upload etc.


Adding a validation service is one such example of a custom addition.

 Andy

On 21/02/18 10:25, Dave Reynolds wrote:

Hi Lorenz,

On 21/02/18 10:04, Lorenz Buehmann wrote:

@Dave

Does it still hold that the reasoner and therefore consistency checking
runs independently of TDB, i.e. it runs in-memory?


Yes.


If so, depending on the size of the data you have to assign enough
memory to the JVM to avoid OOM errors.


Sure, though in this case Maria says the data is in-memory anyway.

Dave


On 21.02.2018 11:01, Dave Reynolds wrote:

Hi Maria,

Sorry but there's not, as far as I'm aware, any support for invoking
consistency checking via Fuseki. The consistency checking in the built
in reasoners is accessible via API calls so you could write your own
reporting tool using that but I don't believe there's anything built
into fuseki.

Dave

On 21/02/18 09:45, Мария Ильина wrote:

Dear members of the community,

I have a problem concerning the use of TDB and Fuseki.

I have created a Fuseki server with an in-memory TDB2 database and
OWLMicro
reasoner. I am using HTTP queries to access the db. This is done by
performing SPARQL queries (both select and insert, delete) via Fuseki
query
service from my Python web app.

However, I could not find any documentation on how to perform
consistency
check via Fuseki over the data stored in TDB. I would also like to
have a
report, showing which triples contradict with each other. Could you
help me
on how to do this with Fuseki and HTTP?

In addition, is it possible to track changes applied to TDB? Any 
version

control / migrations service?

Thank you in advance.

King regards,
Maria Ilyina
Master's student of Novosibirsk State University,
Budker Institute of Nuclear Physics, Russia





Re: Vocabulary for provenance

2018-02-22 Thread Laura Morales
I used "provenance" as in "where does this piece of information come from", but 
it looks like it has a well defined meaning so perhaps I've used the wrong term.
Looks like void is closer to my use case indeed, however prov-o seems to have 
some interesting properties as well.
Thanks for the help.

 
 

Sent: Thursday, February 22, 2018 at 11:39 AM
From: "Martynas Jusevičius" 
To: jena-users-ml 
Subject: Re: Vocabulary for provenance
Since you mention "provenance", PROV ontology would be one option:
https://www.w3.org/TR/prov-o/

But your usage looks more like VoID, more specifically void:inDataset:
https://www.w3.org/TR/void/#backlinks[https://www.w3.org/TR/void/#backlinks]

PROV and VoID can be combined of course.

On Thu, Feb 22, 2018 at 11:35 AM, Laura Morales  wrote:

> Which vocabulary is a good choice to describe provenance or to describe
> graphs? I'd like to use something like this
>
>   "Graph-1"
>   
>
> or like this
>
>   [
>  "Graph-1" ;
>  
> ]
>
> there are so many vocabularies out there that I don't even know where to
> start looking at. Is there anything available for this in schema.org?
> Otherwise I'd like to know if there exist any vocabulary that is used by
> others, and more importantly which is not abandoned or dead.
>
> Thanks.
>


Re: Vocabulary for provenance

2018-02-22 Thread Martynas Jusevičius
Since you mention "provenance", PROV ontology would be one option:
https://www.w3.org/TR/prov-o/

But your usage looks more like VoID, more specifically void:inDataset:
https://www.w3.org/TR/void/#backlinks

PROV and VoID can be combined of course.

On Thu, Feb 22, 2018 at 11:35 AM, Laura Morales  wrote:

> Which vocabulary is a good choice to describe provenance or to describe
> graphs? I'd like to use something like this
>
>   "Graph-1"
>   
>
> or like this
>
>   [
>  "Graph-1" ;
>   
> ]
>
> there are so many vocabularies out there that I don't even know where to
> start looking at. Is there anything available for this in schema.org?
> Otherwise I'd like to know if there exist any vocabulary that is used by
> others, and more importantly which is not abandoned or dead.
>
> Thanks.
>


Vocabulary for provenance

2018-02-22 Thread Laura Morales
Which vocabulary is a good choice to describe provenance or to describe graphs? 
I'd like to use something like this

  "Graph-1"
  

or like this

  [
 "Graph-1" ;
  
]

there are so many vocabularies out there that I don't even know where to start 
looking at. Is there anything available for this in schema.org? Otherwise I'd 
like to know if there exist any vocabulary that is used by others, and more 
importantly which is not abandoned or dead.

Thanks.


Antw: Re: Reasoners for RDFS + owl:sameAs: performance, stability & best practices

2018-02-22 Thread Andreas Kahl
Hello Dave and Alexis, 

Thanks for your advice, I will give this a try. (Especially the
GenericRule-Reasoner)
This plus removal of all non Whitelisted sameAs links could be a good
combination. 

Best Regards
Andreas


>>> Alexis Armin Huf  20.02.2018 13:43 >>>
Hi Andreas,

I had a similar scenario, but as Dave said there is no
choose-a-enum-value
reasoner for that. What I did was picking the RDFS and owl:sameAs
rules
from the rule files in Jena source and instantiate a
GenericRuleReasoner
with my custom rule file. Docs for how to do this are here:
https://jena.apache.org/documentation/inference/index.html#rules. Below
is
a short walk through of how I set this up.

First, build your rules file. Look for the files in
jena-core/src/main/resources/etc
,
specially rdfs-fb.rules and owl-fb-mini.rules. Your rule file will
look
like this:

-> tableAll().

[rdfs7b: (?a rdf:type rdfs:Class) -> (?a rdfs:subClassOf
rdfs:Resource)]

[rdfs2:  (?p rdfs:domain ?c) -> [(?x rdf:type ?c) <- (?x ?p ?y)] ]
[rdfs3:  (?p rdfs:range ?c)  -> [(?y rdf:type ?c) <- (?x ?p ?y)] ]
[rdfs5a: (?a rdfs:subPropertyOf ?b), (?b rdfs:subPropertyOf ?c) -> (?a
rdfs:subPropertyOf ?c)]
[rdfs5b: (?a rdf:type rdf:Property) -> (?a rdfs:subPropertyOf ?a)]
# ... and this goes on ...

# There are a lot of details around owl:sameAs, but you probably will
need
these:
[sameAs1: (?A owl:sameAs ?B) -> (?B owl:sameAs ?A) ]
[sameAs2: (?A owl:sameAs ?B) (?B owl:sameAs ?C) -> (?A owl:sameAs ?C)
]
[equality1: (?X owl:sameAs ?Y), notEqual(?X,?Y) ->
[(?X ?P ?V) <- (?Y ?P ?V)]
[(?V ?P ?X) <- (?V ?P ?Y)] ]

Save this file a a resource of your application, parse it and create a
GenericRuleReasoner, like this:

ClassLoader loader = SomeClass.class.getClassLoader();
try (BufferedReader reader = new BufferedReader(new
InputStreamReader(loader.getResourceAsStream("rules/rdfs+sameAs.rules"
{
List rules =
Rule.parseRules(Rule.rulesParserFromReader(reader));
GenericRuleReasoner reasoner = new GenericRuleReasoner(rules);
return
ModelFactory.createModelForGraph(reasoner.bind(modelThatNeedsReasoning.getGraph()))
}

Hope that helps!



Dave Reynolds  schrieb am Di., 20. Feb. 2018
um
06:03 Uhr:

> Hi Andreas,
>
> Jena does not currently have any alternative built reasoner for RDFS
+
> owl:sameAs and I'm not aware of any such "equality reasoner" being
in
> development. You could try Pellet, which may offer better
performance.
>
> In fact equality reasoning is notoriously expensive in the general
case,
> the logic is indeed simple but the cost can blow up easily because
it
> leads to a combinatorial number of deductions.
>
> Depending on what problem you are trying to solve your best bet may
be
> to avoid using owl:sameAs reasoning at run time altogether. For
example,
> in some cases it may be possible to do a pass over the data at
ingest
> time to identify all aliases and to only assert in the model some
> "cannonical" URI for each alias equivalence set.
>
> Dave
>
> On 20/02/18 07:17, Andreas Kahl wrote:
> > Hello everyone,
> >
> > I am currently developing a little Jena Model that should be able
to do
> > RDFS inferencing plus owl:sameAs. From the documentation I learned
that
> > the minimal Reasoner for that is OWLmini. During development I
> > experienced some severe performance bottlenecks if a runtime model
> > contains too many owl:sameAs links and generally for nearly all
models
> > exceeding 1000 Statements. Most of the tests simply freeze at some
point
> > if those performance bottlenecks occur, sometimes selecting a
Statement
> > with a SimpleSelector consisting of a subject URI, a predicate URI
and a
> > null Object takes 20secs.
> > There should be not problems with blocking of threads as I run my
> > integration tests single threaded - especially if I am
experiencing
> > failures.
> >
> > I could confine this by using models without inferencing while
> > collecting and adding data spidered from the web, and especially
adding
> > Ontologies last, only where absolutely needed. Also I use a
whitelist
> > internally for domains my spider is allowed to fetch data from;
> > therefore I remove all owl:sameAs Statements containing object URIs
not
> > in this whitelist. In the end, in my querying methods, I clone
that
> > basic model with the collected data and add it to an InfModel:
> >
> > protected static Model getInfModelFrom(Model model) {
> >  final long size = model.size();
> >  LOG.debug("getInfModelFrom: Input size: " +
> > Long.toString(size));
> >  final Model copy = ModelFactory.createDefaultModel();
> >  copy.add(model instanceof InfModel ? ((InfModel)
> > model).getRawModel() : model);
> >  final InfModel infModel =
> > ModelFactory.createInfModel(ReasonerRegistry.getOWLMiniReasoner(),
> > copy);
> >  return infModel;
> >  }
> >
> > The