Good evening,
I am trying to get through the tutorial (I am beginner) and I am experiencing 
unexpected behavior of these queries (even if Im copypasting the tutorials):
Here is the link to referenced tutorial page: 
https://jena.apache.org/tutorials/sparql_datasets.html

First attempt, this query works fine: 

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX : <.>

SELECT *
{ ?s ?p ?o }

Results:

----------------------------------------------------------------------
| s            | p       | o                                         |
======================================================================
| :ds-ng-2.ttl | dc:date | "2005-09-22T05:53:05+01:00"^^xsd:dateTime |
| :ds-ng-1.ttl | dc:date | "2005-07-14T03:18:56+01:00"^^xsd:dateTime |
----------------------------------------------------------------------

Second, this works pretty good too:

PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
PREFIX  dc:     <http://purl.org/dc/elements/1.1/>
PREFIX  :       <.>

SELECT *
{
    { ?s ?p ?o } UNION { GRAPH ?g { ?s ?p ?o } }
}

Results not absolutely the same (the referenced named graph names are not 
exactly the same in the first and the third column (the colon missing and the 
<> instead), and I was not able to change this, although I was trying pretty 
hard as I thought that there could be the cause of my issue)

---------------------------------------------------------------------------------------------
| s            | p        | o                                         | g       
            |
=============================================================================================
| :ds-ng-2.ttl | dc:date  | "2005-09-22T05:53:05+01:00"^^xsd:dateTime |         
            |
| :ds-ng-1.ttl | dc:date  | "2005-07-14T03:18:56+01:00"^^xsd:dateTime |         
            |
| _:b0         | dc:title | "Harry Potter and the Chamber of Secrets" | 
<ds-ng-1.ttl> |
| _:b1         | dc:title | "Harry Potter and the Philospher's Stone" | 
<ds-ng-1.ttl> |
| _:b2         | dc:title | "Harry Potter and the Sorcerer's Stone"   | 
<ds-ng-2.ttl> |
| _:b3         | dc:title | "Harry Potter and the Chamber of Secrets" | 
<ds-ng-2.ttl> |
---------------------------------------------------------------------------------------------

Now, this query is the first that doesnt work at all:

PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX : <.>

SELECT ?title
{
  GRAPH :ds-ng-2.ttl
    { ?b dc:title ?title }
}

Results are blank all the time:
---------
| title |
=========
---------

Same result with this query:

PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
PREFIX  dc:     <http://purl.org/dc/elements/1.1/>
PREFIX  :       <.>

SELECT ?date ?title
{
  ?g dc:date ?date . FILTER (?date > "2005-08-01T00:00:00Z"^^xsd:dateTime )
  GRAPH ?g
      { ?b dc:title ?title }
}

I have tried many things I googled out (but no exact solution for this problem) 
and nothing worked, I have no idea what could be wrong.

Thanks for every support.

Reply via email to