PREFIX foaf:
PREFIX dct:
PREFIX schema:
PREFIX xsd:
CONSTRUCT
{
GRAPH ?graph
{
?order schema:orderedItem ?orderItem .
?orderItem a schema:OrderItem ;
schema:orderedItem ?product ;
schema:orderQuantity ?quantity ;
schema:discount ?discount ;
schema:price ?price .
}
}
WHERE
{
?order_detail_row <#orderID> ?orderID ;
<#productID> ?productID ;
<#unitPrice> ?unitPrice ;
<#quantity> ?quantityString ;
<#discount> ?discountString .
BIND(uri(concat(str($base), "orders/", encode_for_uri(?orderID), "/")) AS ?graph)
BIND(uri(concat(str(?graph), "#this")) AS ?order)
BIND(uri(concat(str(?graph), "#", STRUUID())) AS ?orderItem)
BIND(uri(concat(str($base), "products/", encode_for_uri(?productID), "/#this")) AS ?product)
BIND (STRDT(?unitPrice, xsd:float) AS ?price)
BIND (STRDT(?quantityString, xsd:integer) AS ?quantity)
BIND (STRDT(?discountString, xsd:float) AS ?discount)
}