Re: Issue while reading Model or Graph from Trig Strings

2019-11-22 Thread Andy Seaborne

If you read TriG into model, it takes the default graph only.

The TriG has a named graphs in it.  bdg:T1642 { ... }
Remove the name and it should work.

The Turtle does not have a name (so it is the same as Trig+default graph)

Andy

On 22/11/2019 17:22, Marc Agate wrote:

Hi Martynas !

The method you are pointing me to effectively works and I can use it to solve 
the issue for now. However, the RDFDataMgr documentation says (about read 
methods/operations):

read -- Read data from a location into a Model, Dataset, etc. The methods in 
this class treat all types of Model in the same way. For behavior specific to a 
subtype of Model, use the methods of that specific class.

Therefore, both 
https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFDataMgr.html#read-org.apache.jena.graph.Graph-java.io.StringReader-java.lang.String-org.apache.jena.riot.Lang-
 AND 
https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFDataMgr.html#read-org.apache.jena.rdf.model.Model-java.io.StringReader-java.lang.String-org.apache.jena.riot.Lang-
 should work.

I am wondering why they don't: Am I using them wrongly or is this just a bug ?

Best

Marc

On 2019/11/22 15:56:16, Martynas Jusevičius  wrote:

I think you want to read a Dataset:
https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFDataMgr.html#read-org.apache.jena.query.Dataset-java.io.StringReader-java.lang.String-org.apache.jena.riot.Lang-

On Fri, 22 Nov 2019 at 16.45, Marc Agate  wrote:


Hi all,

I need to build Models or Graphs from strings being a trig serialization
of a rdf resource.
I tried to do using Model.read or RDFDataMgr but both produce empty models
or graphs.
When I do the same operation with Turtle serialization, it works just fine.

What do you think ?

Run the following code to see that by yourself:


https://github.com/buda-base/editserv/blob/master/src/test/java/editservio/bdrc/edit/test/RDFDataMgrCheck.java

Thx

Marc





Re: Access control on Jena/fuseki datasets

2019-11-22 Thread ajs6f
I think that the issue is that Shiro, out of the box, does not address matching 
by query param. You may wish to configure RegExPatternMatcher, which would be 
more flexible.

https://shiro.apache.org/static/1.4.2/apidocs/org/apache/shiro/util/RegExPatternMatcher.html

ajs6f

> On Nov 22, 2019, at 12:43 PM, Jean-Claude Moissinac 
>  wrote:
> 
> @ajs6f I doesnt think that shiro is the problem (perhaps, it is part of the
> solution). I think that the web UI of Fuseki call something which is
> protected. But what?
> The index.html page doesn't contain an evident candidate.
> I think that we have to look in js/app/main.index.js, but it becomes an
> indeep analyze of complex js code...
> --
> Jean-Claude Moissinac
> 
> 
> 
> Le ven. 22 nov. 2019 à 17:49, ajs6f  a écrit :
> 
>> This isn't really a question about Jena, it's a question about Shiro. Have
>> you tried asking that community?
>> 
>> ajs6f
>> 
>>> On Nov 22, 2019, at 11:41 AM, Jean-Claude Moissinac <
>> jean-claude.moissi...@telecom-paristech.fr> wrote:
>>> 
>>> Dear Marco,
>>> 
>>> I think my previous reading of this documentation was right.
>>> My understanding is that the proposed solution is to develop specific
>> Java
>>> code (like the ShiroExampleEvaluator) to implement  the permissions.
>>> I would like just to configure and use fuseki, not start a Java
>> development
>>> I doesn't see clearly , by doing such code,
>>> * if i get something more efficient than what I do with shiro, following
>>> the documentation here
>>> https://jena.apache.org/documentation/fuseki2/fuseki-security.html
>>> 
>>> * if I will be able to manage correctly the user interface while having
>>> some free datasets and some  protected dataset
>>> now, a window to enter a login/pwd is always displayed when I call the
>> user
>>> interface, so I'm not able to give a free access to free datasets
>>> through the user interface
>>> In the section [urls] of shiro.ini, I have the following line to access
>> the
>>> user interface
>>> / = anon
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Jean-Claude Moissinac
>>> 
>>> 
>>> 
>>> Le jeu. 21 nov. 2019 à 16:05, Marco Neumann  a
>>> écrit :
>>> 
 please take a look at
 
 https://jena.apache.org/documentation/permissions/index.html
 
 
 On Thu 21. Nov 2019 at 14:00, Jean-Claude Moissinac <
 jean-claude.moissi...@telecom-paristech.fr> wrote:
 
> Hello
> 
> I would like to give free access to some datasets in my fuseki server
>> and
> control access to other datasets.
> With shiro, I'm able to control the sparql access points like
> https://myserver/dm/sparql
> but I'm not able to give a controlled access to the datasets user
 interface
> https://myserver/dataset.html?tab=query=/controlleddataset
> or
> https://myserver/dataset.html?tab=query=/freedataset
> or
> https://myserver/
> 
> Is there some good practices about the access control in fuseki
 instances?
> 
> Thank's in advance for any advice
> --
> Jean-Claude Moissinac
> 
 --
 
 
 ---
 Marco Neumann
 KONA
 
>> 
>> 



Re: Access control on Jena/fuseki datasets

2019-11-22 Thread Jean-Claude Moissinac
@ajs6f I doesnt think that shiro is the problem (perhaps, it is part of the
solution). I think that the web UI of Fuseki call something which is
protected. But what?
The index.html page doesn't contain an evident candidate.
I think that we have to look in js/app/main.index.js, but it becomes an
indeep analyze of complex js code...
--
Jean-Claude Moissinac



Le ven. 22 nov. 2019 à 17:49, ajs6f  a écrit :

> This isn't really a question about Jena, it's a question about Shiro. Have
> you tried asking that community?
>
> ajs6f
>
> > On Nov 22, 2019, at 11:41 AM, Jean-Claude Moissinac <
> jean-claude.moissi...@telecom-paristech.fr> wrote:
> >
> > Dear Marco,
> >
> > I think my previous reading of this documentation was right.
> > My understanding is that the proposed solution is to develop specific
> Java
> > code (like the ShiroExampleEvaluator) to implement  the permissions.
> > I would like just to configure and use fuseki, not start a Java
> development
> > I doesn't see clearly , by doing such code,
> > * if i get something more efficient than what I do with shiro, following
> > the documentation here
> > https://jena.apache.org/documentation/fuseki2/fuseki-security.html
> >
> > * if I will be able to manage correctly the user interface while having
> > some free datasets and some  protected dataset
> > now, a window to enter a login/pwd is always displayed when I call the
> user
> > interface, so I'm not able to give a free access to free datasets
> > through the user interface
> > In the section [urls] of shiro.ini, I have the following line to access
> the
> > user interface
> > / = anon
> >
> >
> >
> >
> > --
> > Jean-Claude Moissinac
> >
> >
> >
> > Le jeu. 21 nov. 2019 à 16:05, Marco Neumann  a
> > écrit :
> >
> >> please take a look at
> >>
> >> https://jena.apache.org/documentation/permissions/index.html
> >>
> >>
> >> On Thu 21. Nov 2019 at 14:00, Jean-Claude Moissinac <
> >> jean-claude.moissi...@telecom-paristech.fr> wrote:
> >>
> >>> Hello
> >>>
> >>> I would like to give free access to some datasets in my fuseki server
> and
> >>> control access to other datasets.
> >>> With shiro, I'm able to control the sparql access points like
> >>> https://myserver/dm/sparql
> >>> but I'm not able to give a controlled access to the datasets user
> >> interface
> >>> https://myserver/dataset.html?tab=query=/controlleddataset
> >>> or
> >>> https://myserver/dataset.html?tab=query=/freedataset
> >>> or
> >>> https://myserver/
> >>>
> >>> Is there some good practices about the access control in fuseki
> >> instances?
> >>>
> >>> Thank's in advance for any advice
> >>> --
> >>> Jean-Claude Moissinac
> >>>
> >> --
> >>
> >>
> >> ---
> >> Marco Neumann
> >> KONA
> >>
>
>


Re: Issue while reading Model or Graph from Trig Strings

2019-11-22 Thread Marc Agate
Hi Martynas !

The method you are pointing me to effectively works and I can use it to solve 
the issue for now. However, the RDFDataMgr documentation says (about read 
methods/operations):

read -- Read data from a location into a Model, Dataset, etc. The methods in 
this class treat all types of Model in the same way. For behavior specific to a 
subtype of Model, use the methods of that specific class.

Therefore, both 
https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFDataMgr.html#read-org.apache.jena.graph.Graph-java.io.StringReader-java.lang.String-org.apache.jena.riot.Lang-
 AND 
https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFDataMgr.html#read-org.apache.jena.rdf.model.Model-java.io.StringReader-java.lang.String-org.apache.jena.riot.Lang-
 should work.

I am wondering why they don't: Am I using them wrongly or is this just a bug ?

Best

Marc

On 2019/11/22 15:56:16, Martynas Jusevičius  wrote: 
> I think you want to read a Dataset:
> https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFDataMgr.html#read-org.apache.jena.query.Dataset-java.io.StringReader-java.lang.String-org.apache.jena.riot.Lang-
> 
> On Fri, 22 Nov 2019 at 16.45, Marc Agate  wrote:
> 
> > Hi all,
> >
> > I need to build Models or Graphs from strings being a trig serialization
> > of a rdf resource.
> > I tried to do using Model.read or RDFDataMgr but both produce empty models
> > or graphs.
> > When I do the same operation with Turtle serialization, it works just fine.
> >
> > What do you think ?
> >
> > Run the following code to see that by yourself:
> >
> >
> > https://github.com/buda-base/editserv/blob/master/src/test/java/editservio/bdrc/edit/test/RDFDataMgrCheck.java
> >
> > Thx
> >
> > Marc
> >
> 


Re: Access control on Jena/fuseki datasets

2019-11-22 Thread ajs6f
This isn't really a question about Jena, it's a question about Shiro. Have you 
tried asking that community?

ajs6f

> On Nov 22, 2019, at 11:41 AM, Jean-Claude Moissinac 
>  wrote:
> 
> Dear Marco,
> 
> I think my previous reading of this documentation was right.
> My understanding is that the proposed solution is to develop specific Java
> code (like the ShiroExampleEvaluator) to implement  the permissions.
> I would like just to configure and use fuseki, not start a Java development
> I doesn't see clearly , by doing such code,
> * if i get something more efficient than what I do with shiro, following
> the documentation here
> https://jena.apache.org/documentation/fuseki2/fuseki-security.html
> 
> * if I will be able to manage correctly the user interface while having
> some free datasets and some  protected dataset
> now, a window to enter a login/pwd is always displayed when I call the user
> interface, so I'm not able to give a free access to free datasets
> through the user interface
> In the section [urls] of shiro.ini, I have the following line to access the
> user interface
> / = anon
> 
> 
> 
> 
> --
> Jean-Claude Moissinac
> 
> 
> 
> Le jeu. 21 nov. 2019 à 16:05, Marco Neumann  a
> écrit :
> 
>> please take a look at
>> 
>> https://jena.apache.org/documentation/permissions/index.html
>> 
>> 
>> On Thu 21. Nov 2019 at 14:00, Jean-Claude Moissinac <
>> jean-claude.moissi...@telecom-paristech.fr> wrote:
>> 
>>> Hello
>>> 
>>> I would like to give free access to some datasets in my fuseki server and
>>> control access to other datasets.
>>> With shiro, I'm able to control the sparql access points like
>>> https://myserver/dm/sparql
>>> but I'm not able to give a controlled access to the datasets user
>> interface
>>> https://myserver/dataset.html?tab=query=/controlleddataset
>>> or
>>> https://myserver/dataset.html?tab=query=/freedataset
>>> or
>>> https://myserver/
>>> 
>>> Is there some good practices about the access control in fuseki
>> instances?
>>> 
>>> Thank's in advance for any advice
>>> --
>>> Jean-Claude Moissinac
>>> 
>> --
>> 
>> 
>> ---
>> Marco Neumann
>> KONA
>> 



Re: Access control on Jena/fuseki datasets

2019-11-22 Thread Jean-Claude Moissinac
Dear Marco,

I think my previous reading of this documentation was right.
My understanding is that the proposed solution is to develop specific Java
code (like the ShiroExampleEvaluator) to implement  the permissions.
I would like just to configure and use fuseki, not start a Java development
I doesn't see clearly , by doing such code,
* if i get something more efficient than what I do with shiro, following
the documentation here
https://jena.apache.org/documentation/fuseki2/fuseki-security.html

* if I will be able to manage correctly the user interface while having
some free datasets and some  protected dataset
now, a window to enter a login/pwd is always displayed when I call the user
interface, so I'm not able to give a free access to free datasets
through the user interface
In the section [urls] of shiro.ini, I have the following line to access the
user interface
/ = anon




--
Jean-Claude Moissinac



Le jeu. 21 nov. 2019 à 16:05, Marco Neumann  a
écrit :

> please take a look at
>
> https://jena.apache.org/documentation/permissions/index.html
>
>
> On Thu 21. Nov 2019 at 14:00, Jean-Claude Moissinac <
> jean-claude.moissi...@telecom-paristech.fr> wrote:
>
> > Hello
> >
> > I would like to give free access to some datasets in my fuseki server and
> > control access to other datasets.
> > With shiro, I'm able to control the sparql access points like
> > https://myserver/dm/sparql
> > but I'm not able to give a controlled access to the datasets user
> interface
> > https://myserver/dataset.html?tab=query=/controlleddataset
> > or
> > https://myserver/dataset.html?tab=query=/freedataset
> > or
> > https://myserver/
> >
> > Is there some good practices about the access control in fuseki
> instances?
> >
> > Thank's in advance for any advice
> > --
> > Jean-Claude Moissinac
> >
> --
>
>
> ---
> Marco Neumann
> KONA
>


Re: Caching in Fuseki service

2019-11-22 Thread ajs6f
You would provide both datasets at Fuseki and then us a reverse proxy (like 
Varnish) to switch between the two endpoints. Anything more specific would 
depend on the reverse proxy you select.

ajs6f

> On Nov 22, 2019, at 1:06 AM, Martynas Jusevičius  
> wrote:
> 
> Varnish is a reverse proxy cache:
> https://varnish-cache.org/docs/trunk/tutorial/introduction.html
> 
> On Fri, 22 Nov 2019 at 01.33, Amandeep Srivastava <
> amandeep.srivastava1...@gmail.com> wrote:
> 
>> Thanks Andy, ajs6f
>> 
>> I wanted to use the soft links because I'll be updating my database once
>> every month. Whenever I have a new database, I'll overwrite  inactive
>> database and point the softlink to it making it active and the current one
>> inactive (stale) without bringing down fuseki and losing any requests. Next
>> time I would overwrite second database and switch back to it.  But seems,
>> that won't work because of caching.
>> 
>> Can you please elaborate how to do it using reverse proxy?
>> 
>> 
>> On Thu, 21 Nov, 2019, 11:08 PM Andy Seaborne,  wrote:
>> 
>>> 
>>> 
>>> On 21/11/2019 17:16, ajs6f wrote:
 Why wouldn't you just load these as two separate datasets available at
>>> different endpoints in one instance of Fuseki? Why try to fool Fuseki
>> into
>>> thinking that two datasets are really one?
>>> 
>>> Agreed.
>>> 
 
 ajs6f
 
> On Nov 21, 2019, at 6:57 AM, Amandeep Srivastava <
>>> amandeep.srivastava1...@gmail.com> wrote:
> 
> Hi,
> 
> Is there any resource that talks about caching in Fuseki service?
> 
> Is is handled by Fuseki server itself or the TDB? (I'm using tdb
>>> dataset in
> the backend as input) And can we disable the cache?
> 
> My use case is to query two dumps, one old and one new and I'm setting
>>> - -
> loc to a soft link pointing to the new dump while running fuseki.
>>> 
>>> In effect, symbolic links are resolved at he start and never checked
>> again.
>>> 
> At times,
> I wish to point my soft link to the older dump and query that. I don't
>>> want
> to run another instance of the server.
> 
> By understanding caching, I just want to make sure that when I point
>> my
> soft link to new location, fuseki service doesn't use its older cache
>> to
> answer incoming queries.
>>> 
>>> You can't manipulate the file system going underneath Fuseki or TDB.
>>> Mostly, likely it simply won't notice (the file are already open) but it
>>> may be worse.
>>> 
>>> If you want to swap datasets in-place you'll need to stop and restart
>>> Fuseki.
>>> 
>>> One different way is to use a reverse proxy (httpd for example) and have
>>> two Fuseki servers. Switchover in the reverse proxy - they usually
>>> reload configs while running, preserving oustanding requests.
>>> 
>>> Andy
>>> 
>>> 
>>> 
> 
> Thanks,
> Aman
 
>>> 
>> 



Re: Access control on Jena/fuseki datasets

2019-11-22 Thread Jean-Claude Moissinac
Dear Andy,

Thank's for your reply.
But, as said in my starting email, my problem is to control the access of
the datasets in the user interface? Because, I need the user interface.
A tuned configuration for Shiro does the job for the sparql endpoints
A way could be to produce a specific user interface for access to the free
datasets. I need to check for the feasibility.

--
Jean-Claude Moissinac



Le jeu. 21 nov. 2019 à 18:32, Andy Seaborne  a écrit :

> A different approach is to use:
>
> https://jena.apache.org/documentation/fuseki2/data-access-control
>
> This goes with fuseki-main rather than fuseki-full.
>
> That works particularly well when you don't want the UI.
>
>  Andy
>
>
> On 21/11/2019 13:59, Jean-Claude Moissinac wrote:
> > Hello
> >
> > I would like to give free access to some datasets in my fuseki server and
> > control access to other datasets.
> > With shiro, I'm able to control the sparql access points like
> > https://myserver/dm/sparql
> > but I'm not able to give a controlled access to the datasets user
> interface
> > https://myserver/dataset.html?tab=query=/controlleddataset
> > or
> > https://myserver/dataset.html?tab=query=/freedataset
> > or
> > https://myserver/
> >
> > Is there some good practices about the access control in fuseki
> instances?
> >
> > Thank's in advance for any advice
> > --
> > Jean-Claude Moissinac
> >
>


Re: Issue while reading Model or Graph from Trig Strings

2019-11-22 Thread Martynas Jusevičius
I think you want to read a Dataset:
https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFDataMgr.html#read-org.apache.jena.query.Dataset-java.io.StringReader-java.lang.String-org.apache.jena.riot.Lang-

On Fri, 22 Nov 2019 at 16.45, Marc Agate  wrote:

> Hi all,
>
> I need to build Models or Graphs from strings being a trig serialization
> of a rdf resource.
> I tried to do using Model.read or RDFDataMgr but both produce empty models
> or graphs.
> When I do the same operation with Turtle serialization, it works just fine.
>
> What do you think ?
>
> Run the following code to see that by yourself:
>
>
> https://github.com/buda-base/editserv/blob/master/src/test/java/editservio/bdrc/edit/test/RDFDataMgrCheck.java
>
> Thx
>
> Marc
>


Issue while reading Model or Graph from Trig Strings

2019-11-22 Thread Marc Agate
Hi all,

I need to build Models or Graphs from strings being a trig serialization of a 
rdf resource.
I tried to do using Model.read or RDFDataMgr but both produce empty models or 
graphs.
When I do the same operation with Turtle serialization, it works just fine.

What do you think ?

Run the following code to see that by yourself:
 
 
https://github.com/buda-base/editserv/blob/master/src/test/java/editservio/bdrc/edit/test/RDFDataMgrCheck.java

Thx

Marc