Chapter 5. Query RDF Graphs

Table of Contents

Functions Supported in SPARQL Queries
Syntax Involving Bnodes (Blank Nodes)
JavaScript Object Notation (JSON) Format Support
Best Practices
Additional Query Options
JOIN_METHOD option
SPARQL 1.1 federated query SERVICE Clause
Data sampling
Query hints

The RDF Graph feature has native support for World Wide Web Consortium (W3C) standards. SPARQL is a query language designed specifically for graph pattern matching queries, and RDF and OWL are standards for representing and defining graph data. Oracle NoSQL Database stores RDF data as an array of bytes. It supports non-ASCII characters to accommodate a wide range of international characters.

Functions Supported in SPARQL Queries

SPARQL queries can use functions in the function library of the Apache Jena ARQ query engine. These queries are executed in the middle tier.

The following examples use the upper-case and namespace functions. In these examples, the prefix fn is http://www.w3.org/2005/xpath-functions# and the prefix afn is http://jena.hpl.hp.com/ARQ/function#.

PREFIX dc:  <http://purl.org/dc/elements/1.1/>
PREFIX fn:  <http://www.w3.org/2005/xpath-functions#>
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
SELECT (fn:upper-case(?object) as ?object1)
WHERE { ?subject dc:title ?object }

PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
SELECT ?subject (afn:namespace(?object) as ?object1)
WHERE { 
?subject <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
?object }