Hi Esra,

> I installed Virtuoso on Windows. Now I want to work with Sparql queries 
> (connected to Openlink Virtuoso on cmd). 
> 
> I have an rdf file called 'example.rdf'. I want to run this Sparql query:
> 
> SPARQL PREFIX ore:<http://www.openarchives.org/ore/terms/> PREFIX 
> dc:<http:purl.org/dc/elements/1.1/> SELECT distinct ?resource ?title FROM 
> <D:/example.rdf/> WHERE {?resource ore:proxyIn ?proxy . ?resource dc:title 
> ?title .};
> 
> The result: resource title LONG VARCHAR LONG VARCHAR
> 
> 
> So I get empty results instead of resource and title values. How can I get 
> these two columns?  
> 
> I'm sure that my Sparql query is correct because I get the title and resource 
> values when I am running the same Sparql above on Java or on R.
> 
> 
> I notice that I get empty result on every running Sparql on Virtuoso. For 
> example, also at this query I get empty result:
> 
> SPARQL SELECT ?p ?s WHERE { { SELECT DISTINCT ?p ?s FROM <http://dbpedia.org> 
> WHERE { ?s ?p <http://dbpedia.org/resource/Germany> } ORDER BY ASC(?p)
> } } OFFSET 50000 LIMIT 1000;
> 
> The result of this query: p s LONG VARCHAR LONG VARCHAR
> 
> How can I solve this problem?  Do I need to install or to do something else 
> for running sparql queries? E.g. jena libraries (I have virt_jena.jar file in 
> the folder jena and virt_jena2.jar in the folder jena2). Thanks!


Before you can query this data, you first need to load it into your virtuoso 
database, which can be done in several ways as described in the following wiki 
document:

        http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtRDFInsert

one of the methods uses this function:

        http://docs.openlinksw.com/virtuoso/fn_rdf_load_rdfxml_mt.html

Copy your example.rdf file into the same directory where your virtuoso database 
is located, as Virtuoso by default is not allowed to read files from your D: 
drive.

Make a connection with the isql.exe tool to your virtuoso database and then 
perform the following command:

        DB.DBA.RDF_LOAD_RDFXML_MT (file_to_string_output ('example.rdf'), '', 
'mygraphname'); 


This command will load the data from the D:/example.rdf file and load it under 
the graph name mygraphname.

After this has completed you an use it:

        SPARQL 
        PREFIX ore:<http://www.openarchives.org/ore/terms/> 
        PREFIX dc:<http:purl.org/dc/elements/1.1/> 
        SELECT distinct ?resource ?title FROM <mygraphname> WHERE {?resource 
ore:proxyIn ?proxy . ?resource dc:title ?title .};


Patrick
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to