This HTML5 document contains 31 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/
atomhttp://atomowl.org/ontologies/atomrdf#
foafhttp://xmlns.com/foaf/0.1/
n17http://vos.openlinksw.com/dataspace/services/wiki/
oplhttp://www.openlinksw.com/schema/attribution#
n2http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/
n4http://docs.openlinksw.com/virtuoso/rdfsparql.
dchttp://purl.org/dc/elements/1.1/
n14http://uriburner.com/c/
n15http://vos.openlinksw.com/dataspace/dav#
n10http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete/sioc.
rdfshttp://www.w3.org/2000/01/rdf-schema#
n16http://rdfs.org/sioc/services#
n7http://vos.openlinksw.com/dataspace/person/dav#
siocthttp://rdfs.org/sioc/types#
n12http://vos.openlinksw.com/dataspace/owiki/wiki/
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
n5http://vos.openlinksw.com/dataspace/owiki#
xsdhhttp://www.w3.org/2001/XMLSchema#
n19http://vos.openlinksw.com/dataspace/person/owiki#
siochttp://rdfs.org/sioc/ns#
Subject Item
n7:this
foaf:made
n2:VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete
Subject Item
n15:this
sioc:creator_of
n2:VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete
Subject Item
n17:item
n16:services_of
n2:VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete
Subject Item
n5:this
sioc:creator_of
n2:VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete
Subject Item
n12:VOS
sioc:container_of
n2:VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete
atom:entry
n2:VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete
atom:contains
n2:VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete
Subject Item
n2:VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete
rdf:type
sioct:Comment atom:Entry
dcterms:created
2017-06-13T05:39:20.806013
dcterms:modified
2017-06-29T07:41:35.320277
rdfs:label
VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete
foaf:maker
n7:this n19:this
dc:title
VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete
opl:isDescribedUsing
n10:rdf
sioc:has_creator
n15:this n5:this
sioc:content
%META:TOPICPARENT{name="VirtTipsAndTricksGuide"}% ---+ Using Expressions inside SPARQL <code>CONSTRUCT {...}</code>, <code>INSERT {...}</code>, or <code>DELETE {...}</code> statements The are times when you may want to post-process existing RDF triples, en route to creating enhanced data views. For instance, you may want to enhance the literal values associated with annotation properties such as <code>rdfs:label</code> and <code>rdfs:comment</code>. You can do this in <code>CONSTRUCT {...}</code>, <code>INSERT {...}</code>, or <code>DELETE {...}</code> construction templates, by including expressions wrapped in back-ticks, i.e. -- <verbatim> `expression` </verbatim> %TOC% ---++ Examples Here some SPARQL 1.1 Update Language examples showcasing how this is achieved using Virtuoso. ---+++ Example showing an expression used inside a CONSTRUCT query <verbatim> CONSTRUCT { ?inst rdfs:label `bif:concat ( ?inst_label, " Instance with up to ", str(?core_val), " logical processor cores and " , str(?sess_val) , " concurrent ODBC sessions from licensed host" )` } FROM <http://uda.openlinksw.com/pricing/> WHERE { ?inst a gr:Individual , oplweb:ProductLicense ; rdfs:label ?inst_label ; oplweb:hasMaximumProcessorCores ?core ; oplweb:hasSessions ?sess . ?core a gr:QuantitativeValueInteger ; gr:hasMaxValueInteger ?core_val . ?sess a gr:QuantitativeValueInteger ; gr:hasValue ?sess_val . } </verbatim> You can see [[http://uriburner.com/c/MBGD7Y][live results of this query]]. ---+++ Example showing an expression used inside an INSERT query <verbatim> SPARQL INSERT INTO GRAPH <urn:mygraph> { ?inst rdfs:label `bif:concat ( ?inst_label, " Instance with up to ", str(?core_val), " logical processor cores and " , str(?sess_val) , " concurrent ODBC sessions from licensed host" )` } FROM <http://uda.openlinksw.com/pricing/> WHERE { ?inst a gr:Individual , oplweb:ProductLicense ; rdfs:label ?inst_label ; oplweb:hasMaximumProcessorCores ?core ; oplweb:hasSessions ?sess . ?core a gr:QuantitativeValueInteger ; gr:hasMaxValueInteger ?core_val . ?sess a gr:QuantitativeValueInteger ; gr:hasValue ?sess_val . }; Done. -- 406 msec. SQL> SPARQL SELECT ?label FROM <urn:mygraph> WHERE { ?inst rdfs:label ?label }; label VARCHAR _______________________________________________________________________________ ODBC Driver (Single-Tier Express Edition) Instance with up to 16 logical processor cores and 5 concurrent ODBC sessions from licensed host ODBC Driver (Single-Tier Express Edition) Instance with up to 16 logical processor cores and 5 concurrent ODBC sessions from licensed host ODBC Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor cores and 5 concurrent ODBC sessions from licensed host ODBC Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor cores and 5 concurrent ODBC sessions from licensed host ODBC Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor cores and 5 concurrent ODBC sessions from licensed host ODBC Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor cores and 5 concurrent ODBC sessions from licensed host JDBC Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor cores and 5 concurrent ODBC sessions from licensed host OLEDB Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor cores and 5 concurrent ODBC sessions from licensed host ADO.NET Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor cores and 5 concurrent ODBC sessions from licensed host 9 Rows. -- 31 msec. </verbatim> ---+++ Example showing an expression used inside a DELETE query <verbatim> SPARQL DELETE FROM GRAPH <urn:mygraph> { ?inst rdfs:label `bif:concat ( "JDBC Driver (Single-Tier Lite Edition) Instance with up to ", str(?core_val), " logical processor cores and ", str(?sess_val), " concurrent ODBC sessions from licensed host" )` } FROM <http://uda.openlinksw.com/pricing/> WHERE { ?inst a gr:Individual , oplweb:ProductLicense ; rdfs:label ?inst_label ; oplweb:hasMaximumProcessorCores ?core ; oplweb:hasSessions ?sess . FILTER ( regex ( ?inst_label, "JDBC Driver" ) ) . ?core a gr:QuantitativeValueInteger ; gr:hasMaxValueInteger ?core_val . ?sess a gr:QuantitativeValueInteger ; gr:hasValue ?sess_val . }; Done. -- 32 msec. SQL> SPARQL SELECT ?label FROM <urn:mygraph> WHERE { ?inst rdfs:label ?label }; label VARCHAR _______________________________________________________________________________ ODBC Driver (Single-Tier Express Edition) Instance with up to 16 logical ... ODBC Driver (Single-Tier Express Edition) Instance with up to 16 logical ... ODBC Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor ... ODBC Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor ... ODBC Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor ... ODBC Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor ... OLEDB Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor ... ADO.NET Driver (Single-Tier Lite Edition) Instance with up to 16 logical processor ... 8 Rows. -- 16 msec. </verbatim> ---++Related * [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]] * [[http://docs.openlinksw.com/virtuoso/rdfsparql.html][Virtuoso Documentation]]
sioc:id
4cae12a54813c53ba2be0e02c8d09eb4
sioc:link
n2:VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete
sioc:has_container
n12:VOS
n16:has_services
n17:item
atom:title
VirtTipsAndTricksGuideExpressionsUsageInConstructInsertDelete
sioc:links_to
n4:html n14:MBGD7Y
atom:source
n12:VOS
atom:author
n7:this
atom:published
2017-06-13T05:39:20Z
atom:updated
2017-06-29T07:41:35Z
sioc:topic
n12:VOS