This tutorial shows how to execute a SPARQL query with type "SELECT". You can find a rich list of Virtuoso SPARQL Queries in the References section.
Choose a SPARQL query from the References list. For this example, let's use the SPARQL query, which dumps all Weblog Posts for the ODS Member "demo". You can find this SPARQL Query in either the ODS SPARQL Queries? or the ODS Weblog SPARQL Queries? list.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX sioc: <http://rdfs.org/sioc/ns#>
PREFIX sioct: <http://rdfs.org/sioc/types#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dct: <http://purl.org/dc/elements/1.1/>
PREFIX dcc: <http://purl.org/dc/terms/>
SELECT DISTINCT ?forum_name
?post
?title
?cr
?url
FROM <http://demo.openlinksw.com/dataspace>
WHERE
{
?forum a sioct:Weblog .
?forum sioc:id ?forum_name .
?forum sioc:scope_of ?role .
?role sioc:function_of <http://demo.openlinksw.com/dataspace/demo#this> .
?forum sioc:container_of ?post .
OPTIONAL { ?post dct:title ?title } .
OPTIONAL { ?post dcc:created ?cr } .
OPTIONAL { ?post sioc:link ?url } .
}
ORDER BY DESC (?cr)



PREFIX sioc: <http://rdfs.org/sioc/ns#>
PREFIX sioct: <http://rdfs.org/sioc/types#>
PREFIX dct: <http://purl.org/dc/elements/1.1/>
PREFIX dcc: <http://purl.org/dc/terms/>
SELECT ?forum_name
?channel
?item_title
?created
FROM <http://demo.openlinksw.com/dataspace>
WHERE
{
?forum a sioct:SubscriptionList ;
sioc:id ?forum_name .
?forum sioc:scope_of ?role .
?role sioc:function_of <http://demo.openlinksw.com/dataspace/demo#this> .
?forum sioc:parent_of ?channel .
?channel sioc:container_of ?post .
OPTIONAL { ?post dct:title ?item_title } .
OPTIONAL { ?post dcc:created ?created } .
}
LIMIT 20
CategorySPARQL CategoryRDF CategoryOpenSource CategoryOAT CategoryDocumentation CategoryTutorial