DistinctSubjects
77
Triples
770
WasGeneratedBy
Text
PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
PREFIX dct:        <http://purl.org/dc/terms/>
PREFIX schema:     <https://schema.org/>
PREFIX xsd:        <http://www.w3.org/2001/XMLSchema#>

CONSTRUCT
{
    GRAPH ?graph
    {
        ?graph dct:title ?productName ;
            foaf:primaryTopic ?product ;
            foaf:topic ?offer .

        ?product a schema:Product ;
            schema:identifier ?productID ;
            schema:name ?productName ;
            schema:provider ?supplier ;
            schema:category ?category ;
            schema:description ?quantityPerUnit ;
            schema:offers ?offer .
            # ?unitsInStock ;
            # ?unitsOnOrder ;
            # ?reorderLevel ;
            # ?discontinued - schema:Discontinued

        # schema:Product has no price of its own - schema:price belongs to schema:Offer,
        # which a product reaches through schema:offers. This is the catalogue price;
        # what a given order line was actually billed at lives on that line's own offer.
        ?offer a schema:Offer ;
            foaf:page ?graph ;
            schema:name "List price" ;
            schema:itemOffered ?product ;
            schema:price ?unitPrice ;
            schema:priceCurrency "USD" .
    }
}
WHERE
{
    ?product_row <#productID> ?productID ;
        <#productName> ?productName ;
        <#supplierID> ?supplierID ;
        <#categoryID> ?categoryID ;
        <#quantityPerUnit> ?quantityPerUnit ;
        <#unitPrice> ?unitPriceString ;
        <#unitsInStock> ?unitsInStockString ;
        <#unitsOnOrder> ?unitsOnOrderString ;
        <#reorderLevel> ?reorderLevelString ;
        <#discontinued> ?discontinuedString .

    BIND (uri(concat(str($base), "products/")) AS ?container)
    BIND(uri(concat(str(?container), encode_for_uri(?productID), "/")) AS ?graph)
    BIND(uri(concat(str(?graph), "#this")) AS ?product)
    BIND(uri(concat(str(?graph), "#offer")) AS ?offer)
    BIND(uri(concat(str($base), "suppliers/", encode_for_uri(?supplierID), "/#this")) AS ?supplier)
    BIND(uri(concat(str($base), "categories/", encode_for_uri(?categoryID), "/#this")) AS ?category)
    BIND (STRDT(?unitPriceString, xsd:float) AS ?unitPrice)
    BIND (STRDT(?unitsInStockString, xsd:integer) AS ?unitsInStock)
    BIND (STRDT(?unitsOnOrderString, xsd:integer) AS ?unitsOnOrder)
    BIND (STRDT(?reorderLevelString, xsd:integer) AS ?reorderLevel)
    BIND (STRDT(?discontinuedString, xsd:integer) AS ?discontinued)
}
Title
Products
Delimiter
,
EndedAtTime
25 October 2026 18:11
File
Query
StartedAtTime
25 October 2026 18:10
Title
Products
FileName
products.csv
Format
Sha1sum (hex)
5a574f1396a686da3ce094ccf3aa0d9d754a7d5e
Title
Products
Text
PREFIX  schema: <https://schema.org/>

SELECT DISTINCT  ?productName (SUM(?sale) AS ?totalSales)
WHERE
  { GRAPH ?orderGraph
      { ?order    schema:orderedItem    ?orderItem .
        ?orderItem  schema:orderedItem  ?product ;
                  schema:price          ?sale
      }
    GRAPH ?productGraph
      { ?product  schema:name  ?productName }
  }
GROUP BY ?product ?productName
ORDER BY DESC(?totalSales)
LIMIT   5
Title
Products by sales
Category variable name
supplierName
Chart type
Series variable name
productCount
Title
Products by supplier
FileName
products.rq
Format
Sha1sum (hex)
b4f8a1d6b28b0824e2a5bb59529b78c3d703be8f
Title
products.rq
Text
PREFIX  schema: <https://schema.org/>

  SELECT DISTINCT  ?product
  WHERE
    { GRAPH ?doc
        { ?product  a                schema:Product ;
                    schema:name      ?productName ;
                    schema:provider  ?supplier ;
                    schema:category  ?category
        }
    }
  ORDER BY ?productName
Title
Select products
Text
PREFIX schema: <https://schema.org/>

SELECT ?supplierName (COUNT(DISTINCT ?product) AS ?productCount)
WHERE {
    GRAPH ?productGraph {
        ?product a schema:Product ;
                 schema:provider ?supplier .
    }
    GRAPH ?supplierGraph {
        ?supplier schema:legalName ?supplierName .
    }
}
GROUP BY ?supplier ?supplierName
ORDER BY DESC(?productCount)
LIMIT 10
Title
Supplier product count
Category variable name
productName
Chart type
Series variable name
totalSales
Title
Top selling products