Using SPARQL 1.1 Assignments
What?
Using SPARQL 1.1 assignments.
Why?
Allows the creation of new values in a query.
How?
Here is example showcasing Virtuoso's support for this functionality:
- Assume the following Raw Data Representation in Turtle:
<#lemonade> <#price> 4 . <#wine> <#price> 6 . <#water> <#price> 1 . <#beer> <#price> 3 . <#liqueur> <#price> 5 .
- Load the sample data using SPARQL 1.1.
INSERT Syntax:
INSERT { GRAPH <urn:sparql:tests:assign> { <#lemonade> <#price> 4 . <#wine> <#price> 6 . <#water> <#price> 1 . <#beer> <#price> 3 . <#liqueur> <#price> 5 . } }
- Let's assign new price:
SELECT ?item (?price*2.3 as ?NewPrice) FROM <urn:sparql:tests:assign> WHERE { ?item <#price> ?price }
- View the SPARQL Query Definition via SPARQL Protocol URL
- View the SPARQL Query Results via SPARQL Protocol URL
Related
- SPARQL 1.1 Features Examples Collection
- SPARQL 1.1. Property Paths
- SPARQL inline data via use of VALUES clause
- Virtuoso SPARQL 1.1 Syntax Tutorial
- SPARQL 1.1 Sub-queries
- SPARQL 1.1 Specification
- SPARQL Protocol (HTTP based Query Service)
- Virtuoso Documentation
- Virtuoso Tips and Tricks Collection