This HTML5 document contains 67 embedded RDF statements represented using HTML+Microdata notation.

The embedded RDF content will be recognized by any processor of HTML5 Microdata.

PrefixNamespace IRI
dctermshttp://purl.org/dc/terms/
n4http://bit.ly/
atomhttp://atomowl.org/ontologies/atomrdf#
foafhttp://xmlns.com/foaf/0.1/
n15http://vos.openlinksw.com/dataspace/services/wiki/
oplhttp://www.openlinksw.com/schema/attribution#
n2http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/
n11http://virtuoso.openlinksw.com/tutorials/sparql/SPARQL_Tutorials_Part_9/SPARQL_Tutorials_Part_9.
n19http://docs.openlinksw.com/virtuoso/rdfsparql.
dchttp://purl.org/dc/elements/1.1/
n21http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/VirtTipsAndTricksSPARQL11BuiltInF/sioc.
n13http://www.w3.org/TR/rdf-sparql-protocol/
n10http://vos.openlinksw.com/dataspace/dav#
rdfshttp://www.w3.org/2000/01/rdf-schema#
n14http://rdfs.org/sioc/services#
siocthttp://rdfs.org/sioc/types#
n6http://vos.openlinksw.com/dataspace/person/dav#
n12http://vos.openlinksw.com/dataspace/owiki/wiki/
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
n7http://vos.openlinksw.com/dataspace/owiki#
xsdhhttp://www.w3.org/2001/XMLSchema#
n17http://vos.openlinksw.com/dataspace/person/owiki#
n23http://www.w3.org/TR/sparql11-query/#
siochttp://rdfs.org/sioc/ns#
Subject Item
n6:this
foaf:made
n2:VirtTipsAndTricksSPARQL11BuiltInF
Subject Item
n10:this
sioc:creator_of
n2:VirtTipsAndTricksSPARQL11BuiltInF
Subject Item
n15:item
n14:services_of
n2:VirtTipsAndTricksSPARQL11BuiltInF
Subject Item
n7:this
sioc:creator_of
n2:VirtTipsAndTricksSPARQL11BuiltInF
Subject Item
n12:VOS
sioc:container_of
n2:VirtTipsAndTricksSPARQL11BuiltInF
atom:entry
n2:VirtTipsAndTricksSPARQL11BuiltInF
atom:contains
n2:VirtTipsAndTricksSPARQL11BuiltInF
Subject Item
n2:VirtTipsAndTricksSPARQL11BuiltInF
rdf:type
sioct:Comment atom:Entry
dcterms:created
2017-06-13T05:41:52.738884
dcterms:modified
2017-06-29T07:41:43.502457
rdfs:label
VirtTipsAndTricksSPARQL11BuiltInF
foaf:maker
n6:this n17:this
dc:title
VirtTipsAndTricksSPARQL11BuiltInF
opl:isDescribedUsing
n21:rdf
sioc:has_creator
n7:this n10:this
sioc:content
%META:TOPICPARENT{name="VirtTipsAndTricksSPARQL11FeaturesExamplesCollection"}% ---+ Virtuoso SPARQL 1.1. Built-In Functions Usage Examples %TOC% ---++What? This guide contains Virtuoso SPARQL 1.1. Built-In Functions Usage Examples Usage example queries which you can run against any SPARQL endpoint that supports SPARQL 1.1 and the ability to allow a verified user perform INSERT operations. ---++Why? Using built-In functions provides flexibility to build accurate and complex queries. ---++How? Here are examples showcasing Virtuoso's support for this functionality: ---+++Functions on RDF Terms * <b>isNumeric</b>: [[http://bit.ly/X5ZawI][See live results]] <verbatim> SELECT * WHERE { ?x ?t ?o . FILTER isNumeric(?o) } LIMIT 10 </verbatim> ---+++Functions on Strings * <b>STRDT</b>: [[http://bit.ly/XPpVGs][See live results]] <verbatim> SELECT ?o, STRDT("123", xsd:integer) WHERE { ?x ?t ?o . } LIMIT 10 </verbatim> * <b>STRLANG</b>: [[http://bit.ly/VmEenq][See live results]] <verbatim> SELECT ?o, STRLANG("chat", "en") WHERE { ?x ?t ?o . } LIMIT 10 </verbatim> * <b>STRLEN</b>: [[http://bit.ly/14qoF1P][See live results]] <verbatim> SELECT ?o, STRLEN(?t) WHERE { ?x ?t ?o . } LIMIT 10 </verbatim> * <b>SUBSTR</b>: [[http://bit.ly/1Nz9PfV][See live results]] **** <verbatim> SELECT DISTINCT ?name1 WHERE { ?x <http://xmlns.com/foaf/0.1/name> ?name1 . ?x <http://xmlns.com/foaf/0.1/mbox> ?mbox1 . ?y <http://xmlns.com/foaf/0.1/name> ?name2 . ?y <http://xmlns.com/foaf/0.1/mbox> ?mbox2 . FILTER (?mbox1 = ?mbox2 && ?name1 != ?name2) . FILTER( bif:length(str(?name1)) > 2 && SUBSTR(?name1, 1) LIKE "%Kingsley%" ) } LIMIT 10 </verbatim> * <b><nowiki>UCASE</nowiki></b>: [[http://bit.ly/1JAMSaT][See live results]] <verbatim> SELECT UCASE(?name1 ) WHERE { ?x <http://xmlns.com/foaf/0.1/name> ?name1 . } LIMIT 10 </verbatim> * <b><nowiki>LCASE</nowiki></b>: [[http://bit.ly/1GQLtbS1][See live results]] <verbatim> SELECT LCASE(?name1 ) WHERE { ?x <http://xmlns.com/foaf/0.1/name> ?name1 . } LIMIT 10 </verbatim> * <b><nowiki>strStarts</nowiki></b>: [[http://bit.ly/1Hy8gOu][See live results]] <verbatim> SELECT ?name1 WHERE { ?x <http://xmlns.com/foaf/0.1/name> ?name1 . FILTER ( strStarts(?name1, "Kingsley") ). } LIMIT 10 </verbatim> * <b><nowiki>strEnds</nowiki></b>: [[http://bit.ly/1FUNDGB][See live results]] <verbatim> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT distinct ?name1 WHERE { ?x foaf:name ?name1 . ?x foaf:mbox ?mbox1 . FILTER ( strEnds(?name1, "hen") ). } LIMIT 10 </verbatim> * <b><nowiki>encode_for_uri</nowiki></b>: [[http://bit.ly/1JALipk][See live results]] <verbatim> SELECT encode_for_uri(?name1) as ?name WHERE { ?x <http://xmlns.com/foaf/0.1/name> ?name1 . FILTER ( bif:contains(?name1, "France") ). } LIMIT 10 </verbatim> * <b>contains</b>: [[http://bit.ly/1oxy85a][See live results]] <verbatim> SELECT * WHERE { ?s ?p ?o . FILTER (if (isliteral(?o), contains(str(?o), "Virtuoso"), false)) } LIMIT 10 </verbatim> * <b>concat</b>: [[http://bit.ly/1zkMZoY][See live results]] <verbatim> SELECT concat (?name1 ,?name2 ) WHERE { ?x <http://xmlns.com/foaf/0.1/name> ?name1 . ?x <http://xmlns.com/foaf/0.1/mbox> ?mbox1 . ?y <http://xmlns.com/foaf/0.1/name> ?name2 . ?y <http://xmlns.com/foaf/0.1/mbox> ?mbox2 . FILTER (?mbox1 = ?mbox2 &amp;&amp; ?name1 != ?name2) . FILTER ( contains(?name1, "Dan") ). } LIMIT 10 </verbatim> * <b>langMatches</b>: [[http://bit.ly/1hnvTYg][See live results]] <verbatim> SELECT ?title WHERE { ?x <http://purl.org/dc/elements/1.1/title> ?title . FILTER langMatches( lang(?title), "EN" ) } LIMIT 10 </verbatim> * <b>regex</b>: [[http://bit.ly/Wvgz5K][See live results]] <verbatim> SELECT ?name WHERE { ?x <http://xmlns.com/foaf/0.1/name> ?name . FILTER regex(?name, "^ali", "i") . } LIMIT 10 </verbatim> ---+++Functions on Numerics * <b>round</b>: [[http://bit.ly/14qpOXh][See live results]] <verbatim> SELECT round(?o) WHERE { ?s a ?c . ?s geo:geometry ?geo . ?s ?p ?o . FILTER ( bif:isnumeric(?o) ) } LIMIT 10 </verbatim> * <b>abs</b>: [[http://bit.ly/XI03LQ][See live results]] <verbatim> SELECT abs (?o) ?geo WHERE { ?s a ?c . ?s geo:geometry ?geo . ?s ?p ?o . FILTER (bif:isnumeric(?o) ) } LIMIT 10 </verbatim> * <b>ceil</b>: [[http://bit.ly/117XiWS][See live results]] <verbatim> SELECT ceil (?o) WHERE { ?s a ?c . ?s geo:geometry ?geo . ?s ?p ?o . FILTER (bif:isnumeric(?o) ) } LIMIT 10 </verbatim> * <b>floor</b>: [[http://bit.ly/126XTNt][See live results]] <verbatim> SELECT floor(?o) WHERE { ?s a ?c . ?s geo:geometry ?geo . ?s ?p ?o . FILTER (bif:isnumeric(?o) ) } LIMIT 10 </verbatim> * <b>rand</b>: [[http://bit.ly/14rT5lj][See live results]] <verbatim> SELECT floor(?o) rand () WHERE { ?s a ?c . ?s geo:geometry ?geo . ?s ?p ?o . FILTER (bif:isnumeric(?o) ) } LIMIT 10 </verbatim> ---+++Functions on Dates and Times * <b>now</b>: [[http://bit.ly/1CWJOA4][See live results]] <verbatim> SELECT now() WHERE { ?s ?p ?o } LIMIT 1 </verbatim> * <b>year</b>: [[http://bit.ly/1waxzRP][See live results]] <verbatim> SELECT year("2011-01-10T14:45:13.815-05:00"^^xsd:dateTime) WHERE { ?s ?p ?o } LIMIT 1 </verbatim> * <b>month</b>: [[http://bit.ly/ZGV4na][See live results]] <verbatim> SELECT month ("2011-01-10T14:45:13.815-05:00"^^xsd:dateTime) WHERE { ?s ?p ?o } LIMIT 1 </verbatim> * <b>day</b>: [[http://bit.ly/1t5hbzU][See live results]] <verbatim> SELECT day("2011-01-10T14:45:13.815-05:00"^^xsd:dateTime) WHERE { ?s ?p ?o } LIMIT 1 </verbatim> * <b>hours</b>: [[http://bit.ly/1zkNi2Q][See live results]] <verbatim> SELECT hours("2011-01-10T14:45:13.815-05:00"^^xsd:dateTime) WHERE { ?s ?p ?o } LIMIT 1 </verbatim> * <b>minutes</b>: [[http://bit.ly/1t5hdYI][See live results]] <verbatim> SELECT minutes("2011-01-10T14:45:13.815-05:00"^^xsd:dateTime) WHERE { ?s ?p ?o } LIMIT 1 </verbatim> * <b>seconds</b>: [[http://bit.ly/10oe4bp][See live results]] <verbatim> SELECT seconds ("2011-01-10T14:45:13.815-05:00"^^xsd:dateTime) WHERE { ?s ?p ?o } LIMIT 1 </verbatim> * <b>TIMEZONE</b>: [[http://bit.ly/1tfTogz][See live results]] <verbatim> SELECT TIMEZONE ("2011-01-10T14:45:13.815-05:00"^^xsd:dateTime) WHERE { ?s ?p ?o } LIMIT 1 </verbatim> * <b>tz</b>: [[http://bit.ly/ZNWY5S][See live results]] <verbatim> SELECT tz("2011-01-10T14:45:13.815-05:00"^^xsd:dateTime) WHERE { ?s ?p ?o } LIMIT 1 </verbatim> ---+++Hash Functions * <b>MD5</b>: [[http://bit.ly/1x9GAau][See live results]] <verbatim> SELECT MD5 ('test') WHERE { ?s ?p ?o } LIMIT 1 </verbatim> * <b>SHA1</b>: [[http://bit.ly/1t5hpan][See live results]] <verbatim> SELECT SHA1 ('test') WHERE { ?s ?p ?o } LIMIT 1 </verbatim> * <b>SHA256</b>: [[http://bit.ly/1t5hqed][See live results]] <verbatim> SELECT SHA256 ('test') WHERE { ?s ?p ?o } LIMIT 1 </verbatim> * <b>SHA384</b>: [[http://bit.ly/1wtOddL][See live results]] <verbatim> SELECT SHA384('test') WHERE { ?s ?p ?o } LIMIT 1 </verbatim> * <b>SHA512</b>: [[http://bit.ly/VlnjQo][See live results]] <verbatim> SELECT SHA512('test') WHERE { ?s ?p ?o } LIMIT 1 </verbatim> ---++Related * [[http://www.w3.org/TR/sparql11-query/#SparqlOps][SPARQL 1.1. Functions Definitions]] * [[http://www.w3.org/TR/rdf-sparql-protocol/][SPARQL Protocol (HTTP based Query Service)]] * [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]] * [[VirtTipsAndTricksSPARQL11FeaturesExamplesCollection][Virtuoso SPARQL 1.1 Usage Examples Collection]] * [[http://virtuoso.openlinksw.com/tutorials/sparql/SPARQL_Tutorials_Part_9/SPARQL_Tutorials_Part_9.html][Virtuoso SPARQL 1.1 Syntax Tutorial]] * [[http://docs.openlinksw.com/virtuoso/rdfsparql.html][Virtuoso Documentation]]
sioc:id
2368a20ae9704f1b6cdd7ca83bd28990
sioc:link
n2:VirtTipsAndTricksSPARQL11BuiltInF
sioc:has_container
n12:VOS
n14:has_services
n15:item
atom:title
VirtTipsAndTricksSPARQL11BuiltInF
sioc:links_to
n4:1wtOddL n4:1x9GAau n4:1t5hpan n4:1tfTogz n4:ZNWY5S n4:1t5hdYI n4:10oe4bp n2:VirtTipsAndTricksSPARQL11FeaturesExamplesCollection n11:html n4:1GQLtbS1 n4:1Hy8gOu n4:1Nz9PfV n13: n4:1JAMSaT n4:VmEenq n4:14qoF1P n4:X5ZawI n4:XPpVGs n19:html n4:1t5hbzU n4:1zkNi2Q n4:1waxzRP n4:ZGV4na n4:14rT5lj n4:1CWJOA4 n4:117XiWS n4:126XTNt n4:14qpOXh n4:XI03LQ n4:1hnvTYg n4:Wvgz5K n4:1oxy85a n4:1zkMZoY n4:1FUNDGB n4:1JALipk n4:VlnjQo n23:SparqlOps n4:1t5hqed
atom:source
n12:VOS
atom:author
n6:this
atom:published
2017-06-13T05:41:52Z
atom:updated
2017-06-29T07:41:43Z
sioc:topic
n12:VOS