About SPARQL not SQL

query language SPARQL (pronounced “sparkle”)

SPARQL in an SQL -like query language for RDF data, spesified by the RDF Data Acess working group of W3C. it differs from SQL in the following aspects:

  • SPARQL does not contain spesific Data Definition Language (DLL) provisions  because the schemas are represented in both RDFS and OWL as standard RDF graphs, thus requiring no specific language to deal with them.
  • SPARQL is not a Data Modification Language (DML), that is, one cannot insert, delete and update RDF graphs using SPARQL. the major reason for this is that there is still no consensus on the optimal DML design for RDF.

SPARQL support four types of queries:

  1. SELECT queries – return n-tuples of results just like the SELECT queries in SQL
  2. DESCRIBE queries – return an RDF graph. the resulting graph describe the resource, which match the query contraints. Usually, a description of  a resource is considered an RDF-molocule, forming the immediate neighborhood of an URI.
  3. ASK queries- provide positive or negative answer indicating whether or not the query pattern can be satisfied.
  4. CONSTRUCT queries – return an RDF graph constructed by means of the substitution of the variables in the graph template and combining the triples into a single RDF graph by set union.

named graph, is an RDf graph with assigned name in the form of a URI reference. in an extended RDF model, one can deal with multiple named graphs  and describe  the graphs, making statement about them, putting their URIs in subject position. while the original definition of named graphs leaves plenty of room for interpretation, a more concrete definition is provided in the specification of SPARQL.

a SPARQL query is composedof five parts zero or more prefix declarations, a query result clause, zero or more FROM or FROM NAMED clauses, a WHERE clause, and zero or more query modifiers. the optional PREFIX declarations introduce shorcuts for  long IRIs as normally done when working with XML namespace. such prefixes can be used in the WHERE clause.

a SPARQL query can take four forms: SELECT, ASK, CONSTRUCT and DESCRIBE.

The WHERE clause is the core of a SPARQL query. It is specified in terms of a set of triple
patterns. As extensively explained in the following sections, these triple patterns are used
to select the triples composing the result.




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s