Re: Fuseki with a web.xml

2015-01-09 Thread Andy Seaborne

On 09/01/15 22:11, Trevor Donaldson wrote:

Is it possible to have a Web.xml file with fuseki. I would like to setup a
filter element. Is this possible?



Yes.

See Fuseki2 which is all web.xml driven including as a WAR file.  (It 
already uses a servlet filter to put Apache Shiro onto the dispatch 
patch for security handling.)


Artifacts:

jena-fuseki-server -- standalone jar
jena-fuseki-war -- war file form
jena-fuseki-dist -- for the binary distribution
  somewhat like Fuseki1
  see the webapp/ directory for the web.xml.

Andy



Re: Fuseki with a web.xml

2015-01-09 Thread Trevor Donaldson
Awesome. That is exactly what I was trying to do. Use shiro. Woohoo. Is
there an example utilizing Shiro and fuseki?
On Jan 9, 2015 6:45 PM, Andy Seaborne a...@apache.org wrote:

 On 09/01/15 22:11, Trevor Donaldson wrote:

 Is it possible to have a Web.xml file with fuseki. I would like to setup a
 filter element. Is this possible?


 Yes.

 See Fuseki2 which is all web.xml driven including as a WAR file.  (It
 already uses a servlet filter to put Apache Shiro onto the dispatch patch
 for security handling.)

 Artifacts:

 jena-fuseki-server -- standalone jar
 jena-fuseki-war -- war file form
 jena-fuseki-dist -- for the binary distribution
   somewhat like Fuseki1
   see the webapp/ directory for the web.xml.

 Andy




RE: Fuseki with a web.xml

2015-01-09 Thread John A. Fereira
I haven't looked at Fuseki2 in a few weeks but did finally get a version 
deployed with includes both a TDB and an SDB datastore, running under Tomcat.  
I've got a project for which I'll need to use Fuseki and would like to use 
Fuseki2 but last time I used it there were still a number of things that didn't 
look complete, primarily with the admin interface.  How much progress has been 
made on that?  When you consider Fuseki2 to be production ready?

-Original Message-
From: Andy Seaborne [mailto:a...@apache.org] 
Sent: Friday, January 9, 2015 6:43 PM
To: users@jena.apache.org
Subject: Re: Fuseki with a web.xml

On 09/01/15 22:11, Trevor Donaldson wrote:
 Is it possible to have a Web.xml file with fuseki. I would like to 
 setup a filter element. Is this possible?


Yes.

See Fuseki2 which is all web.xml driven including as a WAR file.  (It already 
uses a servlet filter to put Apache Shiro onto the dispatch patch for security 
handling.)

Artifacts:

jena-fuseki-server -- standalone jar
jena-fuseki-war -- war file form
jena-fuseki-dist -- for the binary distribution
   somewhat like Fuseki1
   see the webapp/ directory for the web.xml.

Andy



RE: Fuseki with a web.xml

2015-01-09 Thread Trevor Donaldson
Not production ready, yet? Oh no. :-(
On Jan 9, 2015 6:59 PM, John A. Fereira ja...@cornell.edu wrote:

 I haven't looked at Fuseki2 in a few weeks but did finally get a version
 deployed with includes both a TDB and an SDB datastore, running under
 Tomcat.  I've got a project for which I'll need to use Fuseki and would
 like to use Fuseki2 but last time I used it there were still a number of
 things that didn't look complete, primarily with the admin interface.  How
 much progress has been made on that?  When you consider Fuseki2 to be
 production ready?

 -Original Message-
 From: Andy Seaborne [mailto:a...@apache.org]
 Sent: Friday, January 9, 2015 6:43 PM
 To: users@jena.apache.org
 Subject: Re: Fuseki with a web.xml

 On 09/01/15 22:11, Trevor Donaldson wrote:
  Is it possible to have a Web.xml file with fuseki. I would like to
  setup a filter element. Is this possible?
 

 Yes.

 See Fuseki2 which is all web.xml driven including as a WAR file.  (It
 already uses a servlet filter to put Apache Shiro onto the dispatch patch
 for security handling.)

 Artifacts:

 jena-fuseki-server -- standalone jar
 jena-fuseki-war -- war file form
 jena-fuseki-dist -- for the binary distribution
somewhat like Fuseki1
see the webapp/ directory for the web.xml.

 Andy




How to update fuseki from a local model?

2015-01-09 Thread Trevor Donaldson
Hi all,

Is there a way to take a temp model and send the result to fuseki?

What I would like to accomplish :
1. Insert / delete triples in temp model
2. Send results (inserts and deletes) to fuseki to have it update the named
graph

Is this possible or do I need to do build the sparql queries manually?
Thanks


Re: Graph traversal and Jena TDB

2015-01-09 Thread Martynas Jusevičius
There was some interesting research from Microsoft about their Trinity
RDF store, could be relevant here:
http://research.microsoft.com/apps/pubs/default.aspx?id=183717

On Fri, Jan 9, 2015 at 7:05 PM, Andy Seaborne a...@apache.org wrote:
 On 09/01/15 11:08, Olivier Rossel wrote:

 Hi everyone.

 I have this (classical) graph traversal use case:
 in a graph, let's find all the paths from resource A to resource B.

 AFAIU, SPARQL has a dedicated syntax for that.


 http://www.w3.org/TR/sparql11-query/#propertypaths

 (called property path).


 Yes-ish.  You can write

 ?x :property* ?y .

 You can't find out about the path chosen, e.g. length (or how many). ?var*
 is illegal but there are tricks for any property like usage with
 NegatedPropertySets (probably perform badly).

 In my use case, the property paths to match have unknown length.

 I think Virtuoso stores triples in a g,s,p,o table.
 So property paths of unknown length will be translated into a massive
 amount
 of self-joins.
 Does it sound right?


 Ask Openlink?

 Seems likely. As ever there are implementation choices - in RDF stores,
 self-joins are usually not bad (and they are very common).

 How would TDB handle those property paths?
 With a similar strategy?


 Yes [*]

 ([*] unless you run some magic in the query execution engine, for example,
 to support RDFS at scale.)

 And then, the graph databases.


 Of several different kinds - Apache Giraph is very different to Neo4J in
 target usage.

 https://giraph.apache.org/
 https://spark.apache.org/graphx/

 Do they have an internal structure that makes this graph traversal more
 natural?
 Or do they rely, eventually, on similar strategies?


 It's hard to answer simply - it depends on how you look at them.

 One step of parallel graph traversal looks very much like a join to me.

 Neo claim they have no joins because they have pointers (it's comceptually
 an in-memory design as described in the Graph Databases book - the design
 has moved on since that description).  I'd say that looking at all the
 pointer following in parallel, the pointers are remarkably like index joins
 and hash tables, especially as it goes cluster.

 http://graphdatabases.com/

 The analytics engines - Apache Giraph and many others - are fundamentally
 different.  They are node engines with highly parallel transversal.

 Designing Data-Intensive Applications has some material on graph
 databases.
 http://shop.oreilly.com/product/0636920032175.do

 Andy




 Any help of that subject would be of great interest.






Re: How to update fuseki from a local model?

2015-01-09 Thread Trevor Donaldson
I think building the sparql manually is the way to go.

On Fri, Jan 9, 2015 at 1:23 PM, Trevor Donaldson tmdona...@gmail.com
wrote:

 @Andy - Yes there are bNodes in it.

 On Fri, Jan 9, 2015 at 12:49 PM, Andy Seaborne a...@apache.org wrote:

 On 09/01/15 15:13, Trevor Donaldson wrote:

 Hi all,

 Is there a way to take a temp model and send the result to fuseki?

 What I would like to accomplish :
 1. Insert / delete triples in temp model
 2. Send results (inserts and deletes) to fuseki to have it update the
 named
 graph

 Is this possible or do I need to do build the sparql queries manually?
 Thanks


 DatasetAccessor (the SPARQL Graph Store Protocol) might be worth a look -
 but it works on whole graphs so delete some triples out of a large graph is
 not something it can do.

 Otherwise, building SPARQL is probably the way to go.  INSERT DATA,
 DELETE DATA if no

 (Is there any builder code to help with this?  Seems like a good thing to
 have to build INSERT DATA, DELETE DATA operations)

 Trevor - does the data have bNodes in it?

 Andy

 Looking further out ...

 At a lower level, there is RDF Patch

 http://afs.github.io/rdf-patch/

 and some code in:
 https://github.com/afs/jena-rdfpatch

 through I have got sidetracked by a binary version of this based on

 http://afs.github.io/rdf-thrift/





Re: How to update fuseki from a local model?

2015-01-09 Thread Trevor Donaldson
@Andy - Yes there are bNodes in it.

On Fri, Jan 9, 2015 at 12:49 PM, Andy Seaborne a...@apache.org wrote:

 On 09/01/15 15:13, Trevor Donaldson wrote:

 Hi all,

 Is there a way to take a temp model and send the result to fuseki?

 What I would like to accomplish :
 1. Insert / delete triples in temp model
 2. Send results (inserts and deletes) to fuseki to have it update the
 named
 graph

 Is this possible or do I need to do build the sparql queries manually?
 Thanks


 DatasetAccessor (the SPARQL Graph Store Protocol) might be worth a look -
 but it works on whole graphs so delete some triples out of a large graph is
 not something it can do.

 Otherwise, building SPARQL is probably the way to go.  INSERT DATA, DELETE
 DATA if no

 (Is there any builder code to help with this?  Seems like a good thing to
 have to build INSERT DATA, DELETE DATA operations)

 Trevor - does the data have bNodes in it?

 Andy

 Looking further out ...

 At a lower level, there is RDF Patch

 http://afs.github.io/rdf-patch/

 and some code in:
 https://github.com/afs/jena-rdfpatch

 through I have got sidetracked by a binary version of this based on

 http://afs.github.io/rdf-thrift/




Re: How to update fuseki from a local model?

2015-01-09 Thread Martynas Jusevičius
Andy - builder code like this?
https://github.com/Graphity/graphity-client/blob/master/src/main/java/org/graphity/processor/update/InsertDataBuilder.java

It is based on SPIN though, not on Jena directly.

On Fri, Jan 9, 2015 at 6:49 PM, Andy Seaborne a...@apache.org wrote:
 On 09/01/15 15:13, Trevor Donaldson wrote:

 Hi all,

 Is there a way to take a temp model and send the result to fuseki?

 What I would like to accomplish :
 1. Insert / delete triples in temp model
 2. Send results (inserts and deletes) to fuseki to have it update the
 named
 graph

 Is this possible or do I need to do build the sparql queries manually?
 Thanks


 DatasetAccessor (the SPARQL Graph Store Protocol) might be worth a look -
 but it works on whole graphs so delete some triples out of a large graph is
 not something it can do.

 Otherwise, building SPARQL is probably the way to go.  INSERT DATA, DELETE
 DATA if no

 (Is there any builder code to help with this?  Seems like a good thing to
 have to build INSERT DATA, DELETE DATA operations)

 Trevor - does the data have bNodes in it?

 Andy

 Looking further out ...

 At a lower level, there is RDF Patch

 http://afs.github.io/rdf-patch/

 and some code in:
 https://github.com/afs/jena-rdfpatch

 through I have got sidetracked by a binary version of this based on

 http://afs.github.io/rdf-thrift/



Re: Graph traversal and Jena TDB

2015-01-09 Thread Andy Seaborne

On 09/01/15 11:08, Olivier Rossel wrote:

Hi everyone.

I have this (classical) graph traversal use case:
in a graph, let's find all the paths from resource A to resource B.

AFAIU, SPARQL has a dedicated syntax for that.


http://www.w3.org/TR/sparql11-query/#propertypaths


(called property path).


Yes-ish.  You can write

?x :property* ?y .

You can't find out about the path chosen, e.g. length (or how many). 
?var* is illegal but there are tricks for any property like usage with 
NegatedPropertySets (probably perform badly).



In my use case, the property paths to match have unknown length.

I think Virtuoso stores triples in a g,s,p,o table.
So property paths of unknown length will be translated into a massive amount
of self-joins.
Does it sound right?


Ask Openlink?

Seems likely. As ever there are implementation choices - in RDF stores, 
self-joins are usually not bad (and they are very common).



How would TDB handle those property paths?
With a similar strategy?


Yes [*]

([*] unless you run some magic in the query execution engine, for 
example, to support RDFS at scale.)



And then, the graph databases.


Of several different kinds - Apache Giraph is very different to Neo4J in 
target usage.


https://giraph.apache.org/
https://spark.apache.org/graphx/


Do they have an internal structure that makes this graph traversal more natural?
Or do they rely, eventually, on similar strategies?


It's hard to answer simply - it depends on how you look at them.

One step of parallel graph traversal looks very much like a join to me.

Neo claim they have no joins because they have pointers (it's 
comceptually an in-memory design as described in the Graph Databases 
book - the design has moved on since that description).  I'd say that 
looking at all the pointer following in parallel, the pointers are 
remarkably like index joins and hash tables, especially as it goes cluster.


http://graphdatabases.com/

The analytics engines - Apache Giraph and many others - are 
fundamentally different.  They are node engines with highly parallel 
transversal.


Designing Data-Intensive Applications has some material on graph 
databases.

http://shop.oreilly.com/product/0636920032175.do

Andy




Any help of that subject would be of great interest.







Re: How to update fuseki from a local model?

2015-01-09 Thread Andy Seaborne

On 09/01/15 15:13, Trevor Donaldson wrote:

Hi all,

Is there a way to take a temp model and send the result to fuseki?

What I would like to accomplish :
1. Insert / delete triples in temp model
2. Send results (inserts and deletes) to fuseki to have it update the named
graph

Is this possible or do I need to do build the sparql queries manually?
Thanks



DatasetAccessor (the SPARQL Graph Store Protocol) might be worth a look 
- but it works on whole graphs so delete some triples out of a large 
graph is not something it can do.


Otherwise, building SPARQL is probably the way to go.  INSERT DATA, 
DELETE DATA if no


(Is there any builder code to help with this?  Seems like a good thing 
to have to build INSERT DATA, DELETE DATA operations)


Trevor - does the data have bNodes in it?

Andy

Looking further out ...

At a lower level, there is RDF Patch

http://afs.github.io/rdf-patch/

and some code in:
https://github.com/afs/jena-rdfpatch

through I have got sidetracked by a binary version of this based on

http://afs.github.io/rdf-thrift/



Re: Inferencing

2015-01-09 Thread Kamalraj Jairam
Hello Dave and everyone

I have run into one more issue

I have a class “A” and “B” in my ontology for which i have added an equivalent 
class from “Schema.orghttp://Schema.org” and “DBPedia” ontologies (This is to 
provide external context).

Now when i run the reasoner to inter data against my ontology (using OWLMINI or 
OWLMICRO”), takes a very long time to produce results.

So, i started using Pellet to reason my ontologies, but pellet doesn’t reason 
unless i put ontology and the data in the same model .

1) How can i improve the speed of OWLMINI and OWLMICRO to reason DBPEDIA and 
Schema.orghttp://Schema.org

2) Why wouldn’t the following statement work for Pellet ?

Reasoner reasoner = ontModelSpec.getReasoner();

   Reasoner boundReasoner = reasoner.bindSchema(ontModel);
   infModel = ModelFactory.createInfModel(boundReasoner, model);

my infidel does not have inferred statements if i use pellet

Thanks
Kamalraj




On 8 Jan 2015, at 9:44 pm, Dave Reynolds 
dave.e.reyno...@gmail.commailto:dave.e.reyno...@gmail.com wrote:

On 08/01/15 10:35, Kamalraj Jairam wrote:
Hi Dave,

Your solution worked.

I thought the transitive reasoner handled more axioms than Micro_Rule.

No, as it says in the docs the transitive reasoner is very minimal it is mostly 
there as a building block for the more useful reasoners:
https://jena.apache.org/documentation/inference/index.html#transitive

Are there any documentation in the Jena site which shows what entailment does 
each of these Jena reinsures handle?

Yes, the coverage of the different OWL options outlined in:
https://jena.apache.org/documentation/inference/index.html#OWLcoverage

Dave



Re: How to update fuseki from a local model?

2015-01-09 Thread Trevor Donaldson
Could I possible do this ?

DatasetAccessor dataAccessor =
DatasetAccessorFactory.createHTTP(http//localhost:3030/ds);
Model model = dataAcessor.getModel();

OntModel ontmodel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
ontmodel.add(model);

//add, remove etc... do

dataAcessor.add(ontmodel);

Would this do what I want? This seems like overkill for what I need to
do. All I want to do is update a particular graph with new statements
or remove old statements.




On Fri, Jan 9, 2015 at 1:32 PM, Martynas Jusevičius marty...@graphity.org
wrote:

 Andy - builder code like this?

 https://github.com/Graphity/graphity-client/blob/master/src/main/java/org/graphity/processor/update/InsertDataBuilder.java

 It is based on SPIN though, not on Jena directly.

 On Fri, Jan 9, 2015 at 6:49 PM, Andy Seaborne a...@apache.org wrote:
  On 09/01/15 15:13, Trevor Donaldson wrote:
 
  Hi all,
 
  Is there a way to take a temp model and send the result to fuseki?
 
  What I would like to accomplish :
  1. Insert / delete triples in temp model
  2. Send results (inserts and deletes) to fuseki to have it update the
  named
  graph
 
  Is this possible or do I need to do build the sparql queries manually?
  Thanks
 
 
  DatasetAccessor (the SPARQL Graph Store Protocol) might be worth a look -
  but it works on whole graphs so delete some triples out of a large graph
 is
  not something it can do.
 
  Otherwise, building SPARQL is probably the way to go.  INSERT DATA,
 DELETE
  DATA if no
 
  (Is there any builder code to help with this?  Seems like a good thing to
  have to build INSERT DATA, DELETE DATA operations)
 
  Trevor - does the data have bNodes in it?
 
  Andy
 
  Looking further out ...
 
  At a lower level, there is RDF Patch
 
  http://afs.github.io/rdf-patch/
 
  and some code in:
  https://github.com/afs/jena-rdfpatch
 
  through I have got sidetracked by a binary version of this based on
 
  http://afs.github.io/rdf-thrift/
 



Re: How to update fuseki from a local model?

2015-01-09 Thread Trevor Donaldson
I take that back. I am unable to pull back the named graph. That will not
work for me. Looks like manual statements it is.

On Fri, Jan 9, 2015 at 2:47 PM, Trevor Donaldson tmdona...@gmail.com
wrote:

 Could I possible do this ?

 DatasetAccessor dataAccessor = 
 DatasetAccessorFactory.createHTTP(http//localhost:3030/ds);
 Model model = dataAcessor.getModel();

 OntModel ontmodel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
 ontmodel.add(model);

 //add, remove etc... do

 dataAcessor.add(ontmodel);

 Would this do what I want? This seems like overkill for what I need to do. 
 All I want to do is update a particular graph with new statements or remove 
 old statements.




 On Fri, Jan 9, 2015 at 1:32 PM, Martynas Jusevičius marty...@graphity.org
  wrote:

 Andy - builder code like this?

 https://github.com/Graphity/graphity-client/blob/master/src/main/java/org/graphity/processor/update/InsertDataBuilder.java

 It is based on SPIN though, not on Jena directly.

 On Fri, Jan 9, 2015 at 6:49 PM, Andy Seaborne a...@apache.org wrote:
  On 09/01/15 15:13, Trevor Donaldson wrote:
 
  Hi all,
 
  Is there a way to take a temp model and send the result to fuseki?
 
  What I would like to accomplish :
  1. Insert / delete triples in temp model
  2. Send results (inserts and deletes) to fuseki to have it update the
  named
  graph
 
  Is this possible or do I need to do build the sparql queries manually?
  Thanks
 
 
  DatasetAccessor (the SPARQL Graph Store Protocol) might be worth a look
 -
  but it works on whole graphs so delete some triples out of a large
 graph is
  not something it can do.
 
  Otherwise, building SPARQL is probably the way to go.  INSERT DATA,
 DELETE
  DATA if no
 
  (Is there any builder code to help with this?  Seems like a good thing
 to
  have to build INSERT DATA, DELETE DATA operations)
 
  Trevor - does the data have bNodes in it?
 
  Andy
 
  Looking further out ...
 
  At a lower level, there is RDF Patch
 
  http://afs.github.io/rdf-patch/
 
  and some code in:
  https://github.com/afs/jena-rdfpatch
 
  through I have got sidetracked by a binary version of this based on
 
  http://afs.github.io/rdf-thrift/
 





Fuseki with a web.xml

2015-01-09 Thread Trevor Donaldson
Is it possible to have a Web.xml file with fuseki. I would like to setup a
filter element. Is this possible?


Re: How to update fuseki from a local model?

2015-01-09 Thread Andy Seaborne

On 09/01/15 19:47, Trevor Donaldson wrote:

Could I possible do this ?


For the adds, yes.



DatasetAccessor dataAccessor =
DatasetAccessorFactory.createHTTP(http//localhost:3030/ds);
Model model = dataAcessor.getModel();

OntModel ontmodel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
ontmodel.add(model);

//add, remove etc... do

dataAcessor.add(ontmodel);



// Default graph
dataAccessor.add(, Model data) ;

// Named graph
dataAccessor.add(String graphUri, Model data) ;

The DatasetAccessor reflects the structure of the dataset in the server.



Would this do what I want? This seems like overkill for what I need to
do. All I want to do is update a particular graph with new statements
or remove old statements.


Remove is the hard part if that includes blank nodes.

You need to find the blank node with a DELETE {} WHERE {} or it's short 
form DELETE WHERE {}.


Andy






On Fri, Jan 9, 2015 at 1:32 PM, Martynas Jusevičius marty...@graphity.org
wrote:


Andy - builder code like this?

https://github.com/Graphity/graphity-client/blob/master/src/main/java/org/graphity/processor/update/InsertDataBuilder.java

It is based on SPIN though, not on Jena directly.

On Fri, Jan 9, 2015 at 6:49 PM, Andy Seaborne a...@apache.org wrote:

On 09/01/15 15:13, Trevor Donaldson wrote:


Hi all,

Is there a way to take a temp model and send the result to fuseki?

What I would like to accomplish :
1. Insert / delete triples in temp model
2. Send results (inserts and deletes) to fuseki to have it update the
named
graph

Is this possible or do I need to do build the sparql queries manually?
Thanks



DatasetAccessor (the SPARQL Graph Store Protocol) might be worth a look -
but it works on whole graphs so delete some triples out of a large graph

is

not something it can do.

Otherwise, building SPARQL is probably the way to go.  INSERT DATA,

DELETE

DATA if no

(Is there any builder code to help with this?  Seems like a good thing to
have to build INSERT DATA, DELETE DATA operations)

Trevor - does the data have bNodes in it?

 Andy

Looking further out ...

At a lower level, there is RDF Patch

http://afs.github.io/rdf-patch/

and some code in:
https://github.com/afs/jena-rdfpatch

through I have got sidetracked by a binary version of this based on

http://afs.github.io/rdf-thrift/









Graph traversal and Jena TDB

2015-01-09 Thread Olivier Rossel
Hi everyone.

I have this (classical) graph traversal use case:
in a graph, let's find all the paths from resource A to resource B.

AFAIU, SPARQL has a dedicated syntax for that.
(called property path).

In my use case, the property paths to match have unknown length.

I think Virtuoso stores triples in a g,s,p,o table.
So property paths of unknown length will be translated into a massive amount
of self-joins.
Does it sound right?

How would TDB handle those property paths?
With a similar strategy?

And then, the graph databases.
Do they have an internal structure that makes this graph traversal more natural?
Or do they rely, eventually, on similar strategies?

Any help of that subject would be of great interest.