Default graph issue (tdb-backed Fuseki)

2014-01-22 Thread Rohana Rajapakse
Hi,



I have a tdb-backed Fuseki installation. I am  inserting data using INSERT
DATA sparql query (also tried reading triple data from a file) without
giving a named-graph uri (with GRAPH keyword), the query is executed
without errors and in the query forms of the Fuseki web console I see the
message “*Update succeeded*”, but a select query without giving a
named-graph (with GRAPH …) does not show the inserted triples.



It all works when I inserted data into a named-graph using the GRAPH…



Can someone please let me know what is going on.



I am using Fuseki-1.0.0 with Jena-2.11.0



Here is the TDB config file:



#service_tdb_all rdf:type fuseki:Service ;

rdfs:label  TDB Service (RW) ;

fuseki:name data ;

fuseki:serviceQuery query ;

fuseki:serviceQuery sparql ;

fuseki:serviceUpdateupdate ;

fuseki:serviceUploadupload ;

fuseki:serviceReadWriteGraphStore  data ;

# A separate read-only graph store endpoint:

fuseki:serviceReadGraphStore   get ;

fuseki:dataset   #tdb_dataset_readwrite ;

.



#tdb_dataset_readwrite rdf:type  tdb:DatasetTDB ;

tdb:location MYTDB ;

.





Thanks for any help.



Rohana


Error in Sparql using an URI with '+' symbol

2014-01-22 Thread Iturraspe Barturen, Urtza
Good morning to everyone,

I have a very simple SPARQL like this:

PREFIX otn:http://www.demanes.com/2013/
PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema#
PREFIX protege:http://protege.stanford.edu/plugins/owl/protege#
PREFIX p1:http://www.pms.ifi.uni-muenchen.de/OTN#Traditional_Woodland/
PREFIX owl:http://www.w3.org/2002/07/owl#
PREFIX rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#
PREFIX daml:http://www.daml.org/2001/03/daml+oil#
select ?z where {?x ?y ?z}

Problem appear because daml Prefix has a '+' symbol and when I execute this 
QueryFactory.create (query) in my code it produces an Error.


I try putting double slash, single slash but the problem that ignore this 
character?,

What can I do?, some help?

Thank you



Urtza Iturraspe Barturen
Investigador / Researcher

OPTIMA - Optimization Modelling  Analytics Area

ICT - European Software Institute Division

TECNALIA
Parque Tecnológico de Bizkaia, Edificio 202
E-48170 Zamudio (Spain)
mov.: 664 00 21 51
tel.: 902 760 002  /  946 430 850 (International calls)
urtza.iturra...@tecnalia.commailto:urtza.iturra...@tecnalia.com
www.tecnalia.comhttp://www.tecnalia.com/

[faldon_mail]

 AVISO LEGAL   DISCLAIMER 
Este mensaje es personal y confidencial y su uso no autorizado está prohibido 
legalmente. Si usted no es el destinatario, proceda a borrarlo, sin reenviarlo 
ni conservarlo.
This message is personal and confidential, unauthorised use is legally 
prohibited. If you are not the intended recipient, delete it without resending 
or backing it.



Re: Escaping SPARQL regex

2014-01-22 Thread Martynas Jusevičius
Thanks Andy. REUtil.quoteMeta() seems to do the trick.

On Tue, Jan 21, 2014 at 6:22 PM, Andy Seaborne a...@apache.org wrote:
 On 21/01/14 16:58, Martynas Jusevičius wrote:

 Andy,

 what if I'm sending the query to a remote endpoint that does not
 support Java style regex syntax? Do I need to use FmtUtils then?


 FmtUtils does not have code to escape regex metacharacters.
 You'll need to escape all metacharacter by string manipulation.  It's a
 shame that the standard Java RT uses \Q\E

 Perl has quotemeta which implements it's \Q\E



 Looking at the example from SPARQL 1.1 STR() [1]:

 This query selects the set of people who use their work.example
 address in their foaf profile:

 PREFIX foaf: http://xmlns.com/foaf/0.1/
 SELECT ?name ?mbox
   WHERE { ?x foaf:name  ?name ;
  foaf:mbox  ?mbox .
   FILTER regex(str(?mbox), @work\\.example$) }

 How does work.example become work\\.example? Is one backslash
 escaping the regex, and the second one escaping the literal? How do I
 achieve this with Jena?


 Yes. \\ puts a single real \ into the SPARQL string.

 That's how you do it in Jena.
 . is a metacharacter so it needs escaping.
 == \.
 but it's in a SPARQL string so syntax needs to be \\
 == \\.


 The Xerces implement in REUtil.quoteMeta is:

 public static String quoteMeta(String literal) {
 int len = literal.length();
 StringBuffer buffer = null;
 for (int i = 0;  i  len;  i ++) {
 int ch = literal.charAt(i);
 if (.*+?{[()|\\^$.indexOf(ch) = 0) {
 if (buffer == null) {
 buffer = new StringBuffer(i+(len-i)*2);
 if (i  0)  buffer.append(literal.substring(0, i));
 }
 buffer.append((char)'\\');
 buffer.append((char)ch);
 } else if (buffer != null)
 buffer.append((char)ch);
 }
 return buffer != null ? buffer.toString() : literal;
 }

 and there are others via Google.

 Andy



 [1] http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#func-str

 Martynas

 On Tue, Jan 21, 2014 at 10:10 AM, Andy Seaborne a...@apache.org wrote:

 Works for me:

 SELECT * {
VALUES ?o { +35 abc+35def }
FILTER regex(?o , \\Q+35\\E, i)
 }

 and in Java you need  due to both the levels of escaping (Java text,
 SPARQL).

 [[
 Regex: Pattern exception: java.util.regex.PatternSyntaxException:
 Dangling
 meta character '+' near index 0
 ]]
 which gives the game away it's using java regexs :-)

 The regex engine is Java's and the string is used untouched.

 Strictly, it should be XSD v1 which are slightly different:

 http://www.w3.org/TR/xmlschema-2/#regexs

 and there is a strict Xerces provided alternative if you want exact XSD
 regular expressions.

 XSD and Java differs in only very small ways (e.g. XSD has one extra
 modifier flag, m, XSD has no \Q\E, and XSD has Is for unicode code
 blocks inside \p e.g. \p{IsMongolian})

 And now
 http://www.w3.org/TR/xmlschema11-2/#regexs

  Andy


 On 21/01/14 02:32, Joshua TAYLOR wrote:


 My apologies.  I replied too quickly.  I just wrote this test with
 Jena's command line tools. To match the string +35, I had to use the
 \\+35 in the query:

 select ?label where {
 values ?label { +35 -35 }
 filter(regex(str(?label),\\+35))
 }

 -
 | label |
 =
 | +35 |
 -

 That's _two_ slashes in the query string, which means that in Java
 you'd end up writing

 String query = ... + filter(regex(...,\+35\) + ...;

 Sorry for the hasty and inaccurate reply.

 On Mon, Jan 20, 2014 at 9:27 PM, Joshua TAYLOR joshuaaa...@gmail.com
 wrote:


 On Mon, Jan 20, 2014 at 8:48 PM, Martynas Jusevičius
 marty...@graphity.org wrote:


 OK maybe +35 was a bad example. But isn't + a special char in
 SPARQL regex? And there are more like *, ? etc.
 http://www.w3.org/TR/xpath-functions/#regex-syntax




 Oh, good point.  But if it needs to be escape with a slash, then
 wouldn't

  filter regex(str(?label), \+35)

 be fine?  Note that if you're constructing this programmatically, you
 might end up writing code like

   String queryString = ... + filter regex(str(?label), \\\+35\)
 +
 ...;

 --
 Joshua Taylor, http://www.cs.rpi.edu/~tayloj/









RE: Error in Sparql using an URI with '+' symbol

2014-01-22 Thread Iturraspe Barturen, Urtza
Thanks!!
Error was solved , the problem was not in Sparql ;-)
I have noticed that in http request symbol like + is escaped and We have to use 
an encodeURIComponent in javascript for not to quit plus symbol.

Sorry for that!!

Best regards,


-Mensaje original-
De: Chris Dollin [mailto:chris.dol...@epimorphics.com] 
Enviado el: miércoles, 22 de enero de 2014 11:08
Para: users@jena.apache.org
Asunto: Re: Error in Sparql using an URI with '+' symbol

On Wednesday, January 22, 2014 09:47:21 AM Iturraspe Barturen, Urtza wrote:
 Good morning to everyone,
 
 I have a very simple SPARQL like this:
 
 PREFIX otn:http://www.demanes.com/2013/
 PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema#
 PREFIX protege:http://protege.stanford.edu/plugins/owl/protege#
 PREFIX 
 p1:http://www.pms.ifi.uni-muenchen.de/OTN#Traditional_Woodland/
 PREFIX owl:http://www.w3.org/2002/07/owl#
 PREFIX rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#
 PREFIX daml:http://www.daml.org/2001/03/daml+oil#
 select ?z where {?x ?y ?z}
 
 Problem appear because daml Prefix has a '+' symbol and when I execute 
 this QueryFactory.create (query) in my code it produces an Error.

Show code and error message.

(Fed it to the SPARQL validator, which was perfectly happy with it.)

Chris

-- 
The process will be long and ... unreliable. Box, /Star Cops/

Epimorphics Ltd, http://www.epimorphics.com Registered address: Court Lodge, 
105 High Street, Portishead, Bristol BS20 6PT Epimorphics Ltd. is a limited 
company registered in England (number 7016688)



Re: Default graph issue (tdb-backed Fuseki)

2014-01-22 Thread Andy Seaborne

On 22/01/14 09:29, Rohana Rajapakse wrote:

Hi,


Hi there,





I have a tdb-backed Fuseki installation. I am  inserting data using INSERT
DATA sparql query (also tried reading triple data from a file) without
giving a named-graph uri (with GRAPH keyword),


Did you just use the UI or load the data some other way as well?


the query is executed
without errors and in the query forms of the Fuseki web console I see the
message “*Update succeeded*”, but a select query without giving a
named-graph (with GRAPH …) does not show the inserted triples.


Could you try this query please:

SELECT ?s ?s1 ?s2  {
  { ?s ?p ?o }
  UNION
  { GRAPH urn:x-arq:DefaultGraph { ?s1 ?p1 ?o1 } }
  UNION
  { GRAPH ?g2 { ?s2 ?p2 ?o2 } }
}

It looks like you are running with default union graph on - maybe it was 
set globally when the server was started.


Andy


It all works when I inserted data into a named-graph using the GRAPH…



Can someone please let me know what is going on.



I am using Fuseki-1.0.0 with Jena-2.11.0



Here is the TDB config file:



#service_tdb_all rdf:type fuseki:Service ;

 rdfs:label  TDB Service (RW) ;

 fuseki:name data ;

 fuseki:serviceQuery query ;

 fuseki:serviceQuery sparql ;

 fuseki:serviceUpdateupdate ;

 fuseki:serviceUploadupload ;

 fuseki:serviceReadWriteGraphStore  data ;

 # A separate read-only graph store endpoint:

 fuseki:serviceReadGraphStore   get ;

 fuseki:dataset   #tdb_dataset_readwrite ;

 .



#tdb_dataset_readwrite rdf:type  tdb:DatasetTDB ;

 tdb:location MYTDB ;

 .





Thanks for any help.



Rohana





Re: error in Jena Spatial Documentation

2014-01-22 Thread Andy Seaborne



On 21/01/14 22:38, Tim Harsch wrote:

Hi all,
Just a quick note to point out an error I found in the documentation at
http://jena.apache.org/documentation/query/spatial-query.html

Under the section Property Function Library for spatial:withinCircle it
states.
The distance*units*  can be: kilometers/km, miles/mi, meters/m,
centimeters/cm, milimeters/mm or degrees/de, which are
delivered as the optional strings (the default value is kilometers).

Through empirical testing the default unit appers to be miles/mi rather
than kilometers/km.

I was fiddling with Jena Spatial 1.0 not the latest in trunk.

HTH,
Tim


Noted as

https://issues.apache.org/jira/browse/JENA-623

(I'm fairly certain the documentation is right - not sure if it's just 
spatial:withinCircle or for all spatial property functions)


Thanks
Andy


RE: Default graph issue (tdb-backed Fuseki)

2014-01-22 Thread Rohana Rajapakse
Yes it works!

Can you please tell me what you mean by running with default union graph on. 
I thought we always have a default graph, and if no named-graph is specified in 
sparql (update or select) queries, the operations are performed against the 
default graph, i.e. triples being inserted goes in the default graph and select 
queries return data in all graphs (including the default graph).

How can use change default union graph to off?

What exactly is the uri of the default graph?

Thanks

Rohana

-Original Message-
From: Andy Seaborne [mailto:a...@apache.org]
Sent: 22 January 2014 11:09
To: users@jena.apache.org
Subject: Re: Default graph issue (tdb-backed Fuseki)

On 22/01/14 09:29, Rohana Rajapakse wrote:
 Hi,

Hi there,




 I have a tdb-backed Fuseki installation. I am  inserting data using
 INSERT DATA sparql query (also tried reading triple data from a file)
 without giving a named-graph uri (with GRAPH keyword),

Did you just use the UI or load the data some other way as well?

 the query is executed
 without errors and in the query forms of the Fuseki web console I see
 the message *Update succeeded*, but a select query without giving a
 named-graph (with GRAPH ...) does not show the inserted triples.

Could you try this query please:

SELECT ?s ?s1 ?s2  {
   { ?s ?p ?o }
   UNION
   { GRAPH urn:x-arq:DefaultGraph { ?s1 ?p1 ?o1 } }
   UNION
   { GRAPH ?g2 { ?s2 ?p2 ?o2 } }
}

It looks like you are running with default union graph on - maybe it was set 
globally when the server was started.

Andy

 It all works when I inserted data into a named-graph using the
 GRAPH...



 Can someone please let me know what is going on.



 I am using Fuseki-1.0.0 with Jena-2.11.0



 Here is the TDB config file:



 #service_tdb_all rdf:type fuseki:Service ;

  rdfs:label  TDB Service (RW) ;

  fuseki:name data ;

  fuseki:serviceQuery query ;

  fuseki:serviceQuery sparql ;

  fuseki:serviceUpdateupdate ;

  fuseki:serviceUploadupload ;

  fuseki:serviceReadWriteGraphStore  data ;

  # A separate read-only graph store endpoint:

  fuseki:serviceReadGraphStore   get ;

  fuseki:dataset   #tdb_dataset_readwrite ;

  .



 #tdb_dataset_readwrite rdf:type  tdb:DatasetTDB ;

  tdb:location MYTDB ;

  .





 Thanks for any help.



 Rohana






Keep up-to-date with best practice, new releases, webinars and more with our 
free newsletter: http://www.gossinteractive.com/newsletter

Registered Office: 24 Darklake View, Estover, Plymouth, PL6 7TL.

Company Registration No: 3553908

This email contains proprietary information, some or all of which may be 
legally privileged. It is for the intended recipient only. If an addressing or 
transmission error has misdirected this email, please notify the author by 
replying to this email. If you are not the intended recipient you may not use, 
disclose, distribute, copy, print or rely on this email.

Email transmission cannot be guaranteed to be secure or error free, as 
information may be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete or contain viruses. This email and any files attached to it have 
been checked with virus detection software before transmission. You should 
nonetheless carry out your own virus check before opening any attachment. GOSS 
Interactive Ltd accepts no liability for any loss or damage that may be caused 
by software viruses.



Re: Default graph issue (tdb-backed Fuseki)

2014-01-22 Thread Rohana Rajapakse
Dear Andy,

you are absolutely correct. There is tdb:unionDefaultGraph true . in the
config file for a different (read only) endpoint. It seems to affect the
entire datastore (not endpoint specific!)

thanks

Rohana


On 22 January 2014 11:18, Rohana Rajapakse 
rohana.rajapa...@gossinteractive.com wrote:

  Yes it works!

 Can you please tell me what you mean by running with default union graph
 on. I thought we always have a default graph, and if no named-graph is
 specified in sparql (update or select) queries, the operations are
 performed against the default graph, i.e. triples being inserted goes in
 the default graph and select queries return data in all graphs (including
 the default graph).

 How can use change default union graph to off?

 What exactly is the uri of the default graph?

 Thanks

 Rohana


 -Original Message-
 From: Andy Seaborne [mailto:a...@apache.org a...@apache.org]
 Sent: 22 January 2014 11:09
 To: users@jena.apache.org
 Subject: Re: Default graph issue (tdb-backed Fuseki)

 On 22/01/14 09:29, Rohana Rajapakse wrote:
  Hi,

 Hi there,

 
 
 
  I have a tdb-backed Fuseki installation. I am  inserting data using
  INSERT DATA sparql query (also tried reading triple data from a file)
  without giving a named-graph uri (with GRAPH keyword),

 Did you just use the UI or load the data some other way as well?

  the query is executed
  without errors and in the query forms of the Fuseki web console I see
  the message “*Update succeeded*”, but a select query without giving a
  named-graph (with GRAPH …) does not show the inserted triples.

 Could you try this query please:

 SELECT ?s ?s1 ?s2  {
{ ?s ?p ?o }
UNION
{ GRAPH urn:x-arq:DefaultGraph { ?s1 ?p1 ?o1 } }
UNION
{ GRAPH ?g2 { ?s2 ?p2 ?o2 } }
 }

 It looks like you are running with default union graph on - maybe it was
 set globally when the server was started.

 Andy

  It all works when I inserted data into a named-graph using the
  GRAPH…
 
 
 
  Can someone please let me know what is going on.
 
 
 
  I am using Fuseki-1.0.0 with Jena-2.11.0
 
 
 
  Here is the TDB config file:
 
 
 
  #service_tdb_all rdf:type fuseki:Service ;
 
   rdfs:label  TDB Service (RW) ;
 
   fuseki:name data ;
 
   fuseki:serviceQuery query ;
 
   fuseki:serviceQuery sparql ;
 
   fuseki:serviceUpdateupdate ;
 
   fuseki:serviceUploadupload ;
 
   fuseki:serviceReadWriteGraphStore  data ;
 
   # A separate read-only graph store endpoint:
 
   fuseki:serviceReadGraphStore   get ;
 
   fuseki:dataset   #tdb_dataset_readwrite ;
 
   .
 
 
 
  #tdb_dataset_readwrite rdf:type  tdb:DatasetTDB ;
 
   tdb:location MYTDB ;
 
   .
 
 
 
 
 
  Thanks for any help.
 
 
 
  Rohana
 



 Keep up-to-date with best practice, new releases, webinars and more with
 our free newsletter:
 http://www.gossinteractive.com/newsletter

 Registered Office: 24 Darklake View, Estover, Plymouth, PL6 7TL.

 Company Registration No: 3553908

 This email contains proprietary information, some or all of which may be
 legally privileged. It is for the intended recipient only. If an addressing
 or transmission error has misdirected this email, please notify the author
 by replying to this email. If you are not the intended recipient you may
 not use, disclose, distribute, copy, print or rely on this email.

 Email transmission cannot be guaranteed to be secure or error free, as
 information may be intercepted, corrupted, lost, destroyed, arrive late or
 incomplete or contain viruses. This email and any files attached to it have
 been checked with virus detection software before transmission. You should
 nonetheless carry out your own virus check before opening any attachment.
 GOSS Interactive Ltd accepts no liability for any loss or damage that may
 be caused by software viruses.
  #143b9ad660b1e235_



Re: Default graph issue (tdb-backed Fuseki)

2014-01-22 Thread Andy Seaborne

On 22/01/14 11:18, Rohana Rajapakse wrote:

Yes it works!


I take you mean ?s1 is set and ?s is not?

If ?s is set, then check the query you were using to access the data.


Can you please tell me what you mean by running with default union
graph on. I thought we always have a default graph, and if no
named-graph is specified in sparql (update or select) queries, the
operations are performed against the default graph, i.e. triples being
inserted goes in the default graph and select queries return data in all
graphs (including the default graph).


That's right and that's the normal mode of operation.  A separate 
default graph.




How can use change default union graph to off?


It's off unless something sets it on.

The ways that can happen are:

1/ In the dataset assembler:

#dataset rdf:type  tdb:DatasetTDB ;
tdb:location DB ;
tdb:unionDefaultGraph true ;
.

2/ The server section of the config file:

 ja:context [ ja:cxtName tdb:unionDefaultGraph ;  ja:cxtValue true ] ;

3/ the command line or start up script:

--set tdb:unionDefaultGraph=true




What exactly is the uri of the default graph?


The URI urn:x-arq:DefaultGraph is a pseudo named graph that accesses 
the the storage default graph regardless of whether the query default 
graph is the union of all named graphs.


Andy



Thanks

Rohana

-Original Message-
From: Andy Seaborne [mailto:a...@apache.org]
Sent: 22 January 2014 11:09
To: users@jena.apache.org
Subject: Re: Default graph issue (tdb-backed Fuseki)

On 22/01/14 09:29, Rohana Rajapakse wrote:

Hi,


Hi there,





I have a tdb-backed Fuseki installation. I am  inserting data using
INSERT DATA sparql query (also tried reading triple data from a file)
without giving a named-graph uri (with GRAPH keyword),


Did you just use the UI or load the data some other way as well?


the query is executed
without errors and in the query forms of the Fuseki web console I see
the message “*Update succeeded*”, but a select query without giving a
named-graph (with GRAPH …) does not show the inserted triples.


Could you try this query please:

SELECT ?s ?s1 ?s2  {
{ ?s ?p ?o }
UNION
{ GRAPH urn:x-arq:DefaultGraph { ?s1 ?p1 ?o1 } }
UNION
{ GRAPH ?g2 { ?s2 ?p2 ?o2 } }
}

It looks like you are running with default union graph on - maybe it was
set globally when the server was started.

 Andy


It all works when I inserted data into a named-graph using the
GRAPH…



Can someone please let me know what is going on.



I am using Fuseki-1.0.0 with Jena-2.11.0



Here is the TDB config file:



#service_tdb_all rdf:type fuseki:Service ;

 rdfs:label  TDB Service (RW) ;

 fuseki:name data ;

 fuseki:serviceQuery query ;

 fuseki:serviceQuery sparql ;

 fuseki:serviceUpdateupdate ;

 fuseki:serviceUploadupload ;

 fuseki:serviceReadWriteGraphStore  data ;

 # A separate read-only graph store endpoint:

 fuseki:serviceReadGraphStore   get ;

 fuseki:dataset   #tdb_dataset_readwrite ;

 .



#tdb_dataset_readwrite rdf:type  tdb:DatasetTDB ;

 tdb:location MYTDB ;

 .





Thanks for any help.



Rohana



Keep up-to-date with best practice, new releases, webinars and more with
our free newsletter: http://www.gossinteractive.com/newsletter

Registered Office: 24 Darklake View, Estover, Plymouth, PL6 7TL.

Company Registration No: 3553908

This email contains proprietary information, some or all of which may be
legally privileged. It is for the intended recipient only. If an
addressing or transmission error has misdirected this email, please
notify the author by replying to this email. If you are not the intended
recipient you may not use, disclose, distribute, copy, print or rely on
this email.

Email transmission cannot be guaranteed to be secure or error free, as
information may be intercepted, corrupted, lost, destroyed, arrive late
or incomplete or contain viruses. This email and any files attached to
it have been checked with virus detection software before transmission.
You should nonetheless carry out your own virus check before opening any
attachment. GOSS Interactive Ltd accepts no liability for any loss or
damage that may be caused by software viruses.

#




Re: Default graph issue (tdb-backed Fuseki)

2014-01-22 Thread Rohana Rajapakse
yes only s1 is set.


On 22 January 2014 11:41, Andy Seaborne a...@apache.org wrote:

 On 22/01/14 11:18, Rohana Rajapakse wrote:

 Yes it works!


 I take you mean ?s1 is set and ?s is not?

 If ?s is set, then check the query you were using to access the data.


  Can you please tell me what you mean by running with default union
 graph on. I thought we always have a default graph, and if no
 named-graph is specified in sparql (update or select) queries, the
 operations are performed against the default graph, i.e. triples being
 inserted goes in the default graph and select queries return data in all
 graphs (including the default graph).


 That's right and that's the normal mode of operation.  A separate default
 graph.



 How can use change default union graph to off?


 It's off unless something sets it on.

 The ways that can happen are:

 1/ In the dataset assembler:

 #dataset rdf:type  tdb:DatasetTDB ;
 tdb:location DB ;
 tdb:unionDefaultGraph true ;
 .

 2/ The server section of the config file:

  ja:context [ ja:cxtName tdb:unionDefaultGraph ;  ja:cxtValue true ] ;

 3/ the command line or start up script:

 --set tdb:unionDefaultGraph=true




 What exactly is the uri of the default graph?


 The URI urn:x-arq:DefaultGraph is a pseudo named graph that accesses the
 the storage default graph regardless of whether the query default graph is
 the union of all named graphs.

 Andy


 Thanks

 Rohana

 -Original Message-
 From: Andy Seaborne [mailto:a...@apache.org]
 Sent: 22 January 2014 11:09
 To: users@jena.apache.org
 Subject: Re: Default graph issue (tdb-backed Fuseki)

 On 22/01/14 09:29, Rohana Rajapakse wrote:

 Hi,


 Hi there,




 I have a tdb-backed Fuseki installation. I am  inserting data using
 INSERT DATA sparql query (also tried reading triple data from a file)
 without giving a named-graph uri (with GRAPH keyword),


 Did you just use the UI or load the data some other way as well?

  the query is executed
 without errors and in the query forms of the Fuseki web console I see
 the message “*Update succeeded*”, but a select query without giving a
 named-graph (with GRAPH …) does not show the inserted triples.


 Could you try this query please:

 SELECT ?s ?s1 ?s2  {
 { ?s ?p ?o }
 UNION
 { GRAPH urn:x-arq:DefaultGraph { ?s1 ?p1 ?o1 } }
 UNION
 { GRAPH ?g2 { ?s2 ?p2 ?o2 } }
 }

 It looks like you are running with default union graph on - maybe it was
 set globally when the server was started.

  Andy

  It all works when I inserted data into a named-graph using the
 GRAPH…



 Can someone please let me know what is going on.



 I am using Fuseki-1.0.0 with Jena-2.11.0



 Here is the TDB config file:



 #service_tdb_all rdf:type fuseki:Service ;

  rdfs:label  TDB Service (RW) ;

  fuseki:name data ;

  fuseki:serviceQuery query ;

  fuseki:serviceQuery sparql ;

  fuseki:serviceUpdateupdate ;

  fuseki:serviceUploadupload ;

  fuseki:serviceReadWriteGraphStore  data ;

  # A separate read-only graph store endpoint:

  fuseki:serviceReadGraphStore   get ;

  fuseki:dataset   #tdb_dataset_readwrite ;

  .



 #tdb_dataset_readwrite rdf:type  tdb:DatasetTDB ;

  tdb:location MYTDB ;

  .





 Thanks for any help.



 Rohana


 Keep up-to-date with best practice, new releases, webinars and more with
 our free newsletter: http://www.gossinteractive.com/newsletter

 Registered Office: 24 Darklake View, Estover, Plymouth, PL6 7TL.

 Company Registration No: 3553908

 This email contains proprietary information, some or all of which may be
 legally privileged. It is for the intended recipient only. If an
 addressing or transmission error has misdirected this email, please
 notify the author by replying to this email. If you are not the intended
 recipient you may not use, disclose, distribute, copy, print or rely on
 this email.

 Email transmission cannot be guaranteed to be secure or error free, as
 information may be intercepted, corrupted, lost, destroyed, arrive late
 or incomplete or contain viruses. This email and any files attached to
 it have been checked with virus detection software before transmission.
 You should nonetheless carry out your own virus check before opening any
 attachment. GOSS Interactive Ltd accepts no liability for any loss or
 damage that may be caused by software viruses.

 #





Re: Jena support for JSON-LD?

2014-01-22 Thread Phillip Rhodes
I know it's been discussed before, since I think I was the last one
(or one of the last) to bring it up. :-)

To search the archives, try using Gmane.org.
http://dir.gmane.org/search.php?match=jena

But the short version, as I understand it, is that Jena JSONLD support
is here:  https://github.com/afs/jena-jsonld

I don't actually know enough about the history and the project
internals to know why it's separate or if there are plans to pull it
into main Jena or not, but there is support there and usable.  We use
it in a couple of our projects and it works fine.



Phil
This message optimized for indexing by NSA PRISM


On Wed, Jan 22, 2014 at 3:41 PM, Samuel Padgett spadg...@us.ibm.com wrote:


 JSON-LD is now a W3C Recommendation [1]. Has JSON-LD been considered for
 Jena? I was curious if it was in the roadmap or if there are no plans for
 support. It would be nice if JSON-LD were supported natively.

 I searched the JIRA issues for Jena and didn't find anything. (Apologies if
 this has been discussed on the mailing list before... I couldn't find an
 obvious way to search the archives.)

 [1] http://www.w3.org/TR/2014/REC-json-ld-20140116/
 --
 Samuel Padgett | IBM Rational | spadg...@us.ibm.com
 Eclipse Lyo: Enabling tool integration with OSLC


Re: Jena support for JSON-LD?

2014-01-22 Thread Andy Seaborne

On 22/01/14 20:52, Phillip Rhodes wrote:

I know it's been discussed before, since I think I was the last one
(or one of the last) to bring it up. :-)

To search the archives, try using Gmane.org.
http://dir.gmane.org/search.php?match=jena

But the short version, as I understand it, is that Jena JSONLD support
is here:  https://github.com/afs/jena-jsonld

I don't actually know enough about the history and the project
internals to know why it's separate or if there are plans to pull it
into main Jena or not, but there is support there and usable.  We use
it in a couple of our projects and it works fine.


Because I haven't moved it into Jena proper yet :-)  You may notice 
there was a small amount of activity a few days ago - clearing up prior 
to moving to RIOT.  It's just a small matter of finding the time.  Then 
it'll will be in the main build.


The real work is done by https://github.com/jsonld-java/jsonld-java 
(which only depends on other Apache Licensed dependencies). I was 
waiting for jsonld-java to go to v0.3 but I'll move the code in 
depending on v0.2 and switch when they release 0.3.


Andy


Phil
This message optimized for indexing by NSA PRISM


On Wed, Jan 22, 2014 at 3:41 PM, Samuel Padgett spadg...@us.ibm.com wrote:



JSON-LD is now a W3C Recommendation [1]. Has JSON-LD been considered for
Jena? I was curious if it was in the roadmap or if there are no plans for
support. It would be nice if JSON-LD were supported natively.

I searched the JIRA issues for Jena and didn't find anything. (Apologies if
this has been discussed on the mailing list before... I couldn't find an
obvious way to search the archives.)

[1] http://www.w3.org/TR/2014/REC-json-ld-20140116/
--
Samuel Padgett | IBM Rational | spadg...@us.ibm.com
Eclipse Lyo: Enabling tool integration with OSLC




Re: TDB + NQuads

2014-01-22 Thread Adeeb Noor
thanks Andy and Rob.

I was able to store the NQuads file inside the TDB. below is my code:

String directory = /Users/adeebnoor/Downloads/new;

 Dataset dataset = TDBFactory.createDataset(directory);

String source = /Users/adeebnoor/Downloads/relationships.nq;

RDFDataMgr.read(dataset, source) ;


However, I still got zero result of my SPARQL:

String q = SELECT ?s { ?s ?r ?o  . } limit 10  ;

   Query query = QueryFactory.create(q);

  QueryExecution run = QueryExecutionFactory.create(query, dataset);

  ResultSet results = run.execSelect();

  ResultSetFormatter.out(System.out, results, query);

  run.close();

dataset.close();


What should I do ?


Thanks





On Tue, Jan 21, 2014 at 12:52 PM, Rob Vesse rve...@dotnetrdf.org wrote:

 The code you are using only reads the default graph as the warning message
 implies

 If you wish to read quad formats use the newer RDFDataMgr APIs instead
 (see http://jena.apache.org/documentation/io/rdf-input.html for an
 overview), specifically for your case you want to do the following:

 RDFDataMgr.read(dataset, source);

 Your code is only a fragment but if you aren't already I suggest using the
 TDB transaction APIs
 (http://jena.apache.org/documentation/tdb/tdb_transactions.html) to wrap
 this operation in a write transaction remembering to commit() after the
 read() call.

 Rob

 On 21/01/2014 11:13, Adeeb Noor adeeb.n...@colorado.edu wrote:

 I have a NQuads file that I want to store it inside the tdb. Here is the
 code:
 
 String directory =
 /Users/adeebnoor/Documents/uploadDatasets/dataSetsTDB/new;
 
  Dataset dataset = TDBFactory.createDataset(directory);
 
 Model tdb = dataset.getDefaultModel();
 
String source =
 /Users/adeebnoor/Documents/uploadDatasets/dataSource/drugbank_target_ids.
 nq
 ;
 
  FileManager.get().readModel(tdb, source);
 
   System.out.println(Done);
 when I run the code above , I got this warning:
 
 12:05:58 WARN  riot  :: Only triples or default graph
 data expected : named graph data ignored
 
 and when I tried to query the tdb, the result is empty.
 
 Am I doing something wrong here ? or is there another way to handle
 the NQuads format.
 
 thanks
 
 --
 Adeeb Noor
 Ph.D. Candidate
 Dept of Computer Science
 University of Colorado at Boulder
 Cell: 571-484-3303
 Email: adeeb.n...@colorado.edu







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