In this section, we look at a simple first query and show how to execute it with ARQ.
The file " executing that query with the command line query application; This works by matching the triple pattern in the The item enclosed in <> is a URI (actually, it's an IRI) and the item enclosed in "" is a plain literal. Just like Turtle, N3 or N-triples, typed literals are written with ^^ and language tags can be added with @. x is a variable called x. The ? does not form part of the name which is why it does not appear in the table output. There is one match. The query returns the match in the There are helper scripts in the ARQ Set the ARQROOT environment variable to the file location of the ARQ distribution. The distribution usually has the version number in the directory name. In the ARQ directory, execute: You can just put the Set the ARQROOT environment variable to the file location of the ARQ distribution. The distribution usually has the version number in the directory name. In the ARQ directory, execute: You can just put the Cygwin is a Linux-like environment for Windows. You will need to set the classpath to include all the jar files in the ARQ For example, on Windows: where The names of jar files sometimes changes and new jar files do get added - do check this list with your version of ARQ. The commands themselves are in the SELECT ?xWHERE { ?x <http://www.w3.org/2001/vcard-rdf/3.0#FN> "John Smith" }---------------------------------| x |=================================| <http://somewhere/JohnSmith/> |---------------------------------
WHERE clause against the triples in the RDF graph. The predicate and object of the triple are fixed values so the pattern is going to match only triples with those values. The subject is a variable, and there are no other restrictions on the variable. The pattern matches any triples with these predicate and object values, and it matches with solutions for x.x query variable. The output shown was obtained by using one of ARQ's command line applications.Executing the query
bat/ and bin/ directories of the ARQ distribution. They may not be in a Jena distribution. You should check these scripts before use. Windows setup
set ARQROOT=c:\MyProjects\ARQ
bat\sparql.bat --data=doc\Tutorial\vc-db-1.rdf --query=doc\Tutorial\q1.rq
bat/ directory on your classpath or copy the programs out of it. They all depend on ARQROOT.bash scripts for Linux/Cygwin/Unix
export ARQROOT=$HOME/MyProjects/ARQ
bin/sparql --data=doc/Tutorial/vc-db-1.rdf --query=doc/Tutorial/q1.rq
bin/ directory on your classpath or copy the programs out of it. They all depend on ARQROOT.Using the Java command line applications directly
lib/ directory.ARQdir\lib\antlr-2.7.5.jar;ARQdir\lib\arq-extra.jar;ARQdir\lib\arq.jar;ARQdir\lib\commons-logging-1.1.jar;ARQdir\lib\concurrent.jar;ARQdir\lib\icu4j_3_4.jar;ARQdir\lib\iri.jar;ARQdir\lib\jena.jar;ARQdir\lib\jenatest.jar;ARQdir\lib\json.jar;ARQdir\lib\junit.jar;ARQdir\lib\log4j-1.2.12.jar;ARQdir\lib\lucene-core-2.2.0.jar;ARQdir\lib\stax-api-1.0.jar;ARQdir\lib\wstx-asl-3.0.0.jar;ARQdir\lib\xercesImpl.jar;ARQdir\lib\xml-apis.jar
ARQdir is where you unpacked ARQ. This must be all one line.arq package.
聯(lián)系客服