Search code examples
sparqlrdfvirtuoso

Virtuoso SPARQL not retrieving values


I am uploading a RDF file to a Virtuoso Repository vía de graphic interface (ODS-Briefcase). The file is uploaded successfully. However, every time I make a SPARQL query, an empty result is returned.

I have tried with many other files, and I did not have this problem.

This file size is bigger than the previous ones (14MB), so I guess this could be the cause, but I am not sure about it.

Any help in this matter will be appreciated :)

UPDATE I have tried uploading a smaller file (2KB) and the SPARQL returns results as expected. SPARQL query

Result

However, I uploaded again the file (14 MB) and it seems it is not correctly uploaded.

When I try to read it from the ODS-Briefcase of Virtuoso, this happens: Error Reading


Solution

  • To solve problems like this you have to fundamentally understand the task you are performing and how its interpreted using Virtuoso.

    Task at hand: Loading an RDF document into Virtuoso's WebDAV repository (for which ODS-Briefcase provides a front-end), in a manner that results in the content of said RDF document being loaded into the Quad Store (where RDF data is indexed and made available to SPARQL Queries etc.).

    How you achieve your goal:

    Use the ODS-Briefcase UI to create a DET Folder (a folder then provides an automatic conduit between WebDAV storage and the Virtuoso Quad Store) of type: Linked Data Import. One of the attributes (characteristics) of this kind of folder is a Named Graph IRI and Named Graph IRI Base:

    enter image description here

    With your Linked Data Import DET folder in place, you simply upload RDF documents to the newly created folder.

    To verify existence of RDF Language statements imported from an RDF Document placed in this folder simply execute one of the following

    SELECT COUNT (*) 
    FROM {targe-named-graph-iri}
    WHERE {?s ?p ?o}
    

    OR

    SELECT DISTINCT *
    FROM {targe-named-graph-iri}
    WHERE {?s ?o ?o}
    

    You can also leverage Virtuoso's in-built RDF data import middleware (a/k/a Sponger) within a SPARQL query using the pattern:

    DEFINE get:soft "replace" 
    SELECT DISTINCT *
    FROM {rdf-document-uri}
    WHERE {?s ?o ?o}
    

    I hope this brings clarity to options available for importing RDF Document content into the Virtuoso Quad Store (Engine that manages Data represented and RDF Property/Predicate Graphs).