jena-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Seaborne (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (JENA-1419) Documentation issue on the SPARQL datasets
Date Fri, 07 Sep 2018 10:51:00 GMT

     [ https://issues.apache.org/jira/browse/JENA-1419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andy Seaborne resolved JENA-1419.
---------------------------------
       Resolution: Fixed
         Assignee: Andy Seaborne
    Fix Version/s: Jena 3.9.0

Fixed by JENA-1574.

The documentation is fine.


> Documentation issue on the SPARQL datasets
> ------------------------------------------
>
>                 Key: JENA-1419
>                 URL: https://issues.apache.org/jira/browse/JENA-1419
>             Project: Apache Jena
>          Issue Type: Documentation
>          Components: ARQ, Documentation
>    Affects Versions: Jena 3.5.0
>         Environment: ArchLinux
>            Reporter: Jonathan Bisson
>            Assignee: Andy Seaborne
>            Priority: Critical
>             Fix For: Jena 3.9.0
>
>
> In section:
>  [http://jena.apache.org/tutorials/sparql_datasets.html#querying-a-specific-graph]
> The output is empty. As if the graph couldn't be found.
> {noformat}
> PREFIX : <[file:///home/jo/eclipse-workspace/sparql_tutorial_data/]>
>  PREFIX dc: <[http://purl.org/dc/elements/1.1/]>
> SELECT *
>  WHERE
>  { GRAPH ?g
> { ?b dc:title ?title }
> }
> {noformat}
> Gives:
> {noformat}
> --------------------------------------------------------------------
> |b|title|g|
> ====================================================================
> |_:b0|"Harry Potter and the Chamber of Secrets"|<ds-ng-1.ttl>|
> |_:b1|"Harry Potter and the Philospher's Stone"|<ds-ng-1.ttl>|
> |_:b2|"Harry Potter and the Sorcerer's Stone"|<ds-ng-2.ttl>|
> |_:b3|"Harry Potter and the Chamber of Secrets"|<ds-ng-2.ttl>|
> --------------------------------------------------------------------
> {noformat}
> {noformat}
> PREFIX dc: <[http://purl.org/dc/elements/1.1/]>
>  PREFIX : <.>
> SELECT ?title
>  {
>  GRAPH :ds-ng-2.ttl
> { ?b dc:title ?title }
> }
> {noformat}
> Gives
> {noformat}
> ---------
> |title|
> =========
>  ---------
> {noformat}
> Running with Jena 3.5.0, on Linux (Arch)
> {noformat}
>  $ arq --graph ds-dft.ttl --namedgraph ds-ng-1.ttl --namedgraph \
>  ds-ng-2.ttl --query q-ds-3.rq
> {noformat}
> There is also a problem with q-ds-4.rq:
> {noformat}
>  ----------------
> |date|title|
> ================
>  ----------------
> {noformat}
> And same with q-ds-5.rq.
> {noformat}
> ---------------------------------------------------------------------------------------
> |s|p|o|g|
> =======================================================================================
> |:ds-ng-1.ttl|dc:date|"2005-07-14T03:18:56+01:00"^^xsd:dateTime| |
> |:ds-ng-2.ttl|dc:date|"2005-09-22T05:53:05+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>|
> ---------------------------------------------------------------------------------------
> {noformat}
> We see that g and s are not in the same format.
> Looking around, I found that:
>  [https://github.com/apache/jena/blob/master/jena-arq/etc/dataset.ttl]
> And made a dataset such as:
> {noformat}
>  @prefix dc: <[http://purl.org/dc/elements/1.1/]> .
>  @prefix rdfs: <[http://www.w3.org/2000/01/rdf-schema#|http://www.w3.org/2000/01/rdf-schema]>
.
>  @prefix rdf: <[http://www.w3.org/1999/02/22-rdf-syntax-ns#|http://www.w3.org/1999/02/22-rdf-syntax-ns]>
.
>  @prefix xsd: <[http://www.w3.org/2001/XMLSchema#|http://www.w3.org/2001/XMLSchema]>
.
>  @prefix ja: <[http://jena.hpl.hp.com/2005/11/Assembler#|http://jena.hpl.hp.com/2005/11/Assembler]>
.
>  @prefix : <#> .
> <> rdf:type ja:RDFDataset ;
>  ja:defaultGraph
>  [ rdf:type ja:MemoryModel] ;
>  ja:namedGraph [ ja:graphName <[http://example/graph1]> ;
>  ja:graph :data1 ] ;
>  ja:namedGraph [ ja:graphName <[http://example/graph2]> ;
>  ja:graph :data2 ] ;
>  .
>  :data1 rdf:type ja:MemoryModel ;
>  ja:content [ja:externalContent <ds-ng-1.ttl> ;
>  dc:date "2005-07-14T03:18:56+01:00"^^xsd:dateTime] ;
>  .
> :data2 rdf:type ja:MemoryModel ;
>  ja:content [ja:externalContent <ds-ng-2.ttl> ;
>  dc:date "2005-09-22T05:53:05+01:00"^^xsd:dateTime] ;
>  .
> {noformat}
> Using that I was able to query them, but still not by date. There
>  doesn't seem to be a default graph anymore.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message