FileName
andrew.jpg
Format
Sha1sum (hex)
85035ad6281696a74a3f060ddbc16bf5f31d10f1
Title
andrew.jpg
FileName
anne.jpg
Format
Sha1sum (hex)
5d75b1f3af23c47f17630ffcc8e4f5f32883c086
Title
anne.jpg
Text
PREFIX dct:        <http://purl.org/dc/terms/>
PREFIX schema:     <https://schema.org/>

CONSTRUCT
{
    GRAPH ?graph
    {
        # the employee's title, exactly as employees.rq writes it (the CSV carries the last name for that
        # alone): the two imports run concurrently, and whichever reaches an employee's document first
        # creates it, which a document without a dct:title cannot be
        ?graph dct:title ?lastName .

        ?employee schema:areaServed ?territory
    }
}
WHERE
{
    ?employee_territory <#employeeID> ?employeeID ;
        <#lastName> ?lastName ;
        <#territoryID> ?territoryID .

    BIND(uri(concat(str($base), "employees/")) AS ?container)
    BIND(uri(concat(str(?container), encode_for_uri(?employeeID), "/")) AS ?graph)
    BIND(uri(concat(str(?graph), "#this")) AS ?employee)
    BIND(uri(concat(str($base), "territories/", encode_for_uri(?territoryID), "/#this")) AS ?territory)
}
Title
Employee territories
Delimiter
,
EndedAtTime
30 September 2026 01:30
StartedAtTime
30 September 2026 01:29
Title
Employee territories
FileName
employee_territories.csv
Format
Sha1sum (hex)
e92899742b1baf3a8ec9aed484690b6cc7795a52
Title
Employee territories
FileName
employee_territories.rq
Format
Sha1sum (hex)
a42cb3f2eabdea1ba69e88639778af22e6493008
Title
employee_territories.rq
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#>
PREFIX geo:        <http://www.w3.org/2003/01/geo/wgs84_pos#>

CONSTRUCT
{
    GRAPH ?graph
    {
        ?graph dct:title ?lastName ;
            foaf:primaryTopic ?employee ;
            foaf:topic ?postalAddress .

        ?employee a schema:Person ;
            schema:identifier ?employeeID ;
            dct:title ?lastName ;
            dct:description ?title ;
            schema:givenName ?firstName ;
            schema:familyName ?lastName ;
            schema:jobTitle ?title ;
            schema:honorificPrefix  ?titleOfCourtesy ;
            schema:birthDate ?birthDate;
            # ?hireDate
            schema:address ?postalAddress ;
            schema:telephone ?homePhone ;
            schema:telephone ?extension ;
            schema:description ?notes ;
            schema:sponsor ?reportsToEmployee ;
            geo:lat ?lat ;
            geo:long ?long ;
            foaf:img ?photo .

        ?postalAddress a schema:PostalAddress ;
            foaf:page ?graph ;
            schema:addressCountry ?country ;
            schema:addressLocality ?city ;
            schema:postalCode ?postalCode ;
            schema:streetAddress ?address ;
            schema:addressRegion ?region .
    }
}
WHERE
{
    ?employee_row <#employeeID> ?employeeID ;
        <#lastName> ?lastName ;
        <#firstName> ?firstName ;
        <#title> ?title ;
        <#titleOfCourtesy> ?titleOfCourtesy ;
        <#birthDate> ?birthDateString ;
        <#hireDate> ?hireDateString ;
        <#address> ?address ;
        <#city> ?city ;
        <#postalCode> ?postalCode ;
        <#country> ?country ;
        <#homePhone> ?homePhone ;
        <#extension> ?extension ;
        <#photoHash> ?photoHash ;
        <#notes> ?notes ;
        <#lat> ?lat_string ;
        <#long> ?long_string .

    OPTIONAL {
        ?employee_row <#region> ?region
    }
    OPTIONAL {
        ?employee_row <#reportsTo> ?reportsTo
        BIND(uri(concat(str($base), "employees/", encode_for_uri(?reportsTo), "/#this")) AS ?reportsToEmployee) # cannot use ?container since it's undefined in the OPTIONAL scope
    }

    BIND(uri(concat(str($base), "employees/")) AS ?container)
    BIND(uri(concat(str(?container), encode_for_uri(?employeeID), "/")) AS ?graph)
    BIND(uri(concat(str(?graph), "#this")) AS ?employee)
    BIND(uri(concat(str(?graph), "#address")) AS ?postalAddress)
    BIND(xsd:float(?lat_string) AS ?lat)
    BIND(xsd:float(?long_string) AS ?long)
    BIND(strdt(substr(?birthDateString, 1, 10), xsd:date) AS ?birthDate)
    BIND(strdt(substr(?hireDateString, 1, 10), xsd:date) AS ?hireDate)
    BIND(uri(concat(str($base), "uploads/", encode_for_uri(?photoHash))) AS ?photo)
}
Title
Employees
Delimiter
,
EndedAtTime
30 September 2026 01:29
File
Query
StartedAtTime
30 September 2026 01:29
Title
Employees
FileName
employees.csv
Format
Sha1sum (hex)
eec487aa3be31050014d897aa732262b6c9edc35
Title
Employees
FileName
employees.rq
Format
Sha1sum (hex)
65392261093a85c606dbadf5b3d04dafaf96e973
Title
employees.rq
DistinctSubjects
49
Triples
147
WasGeneratedBy
DistinctSubjects
9
Triples
166
WasGeneratedBy
FileName
janet.jpg
Format
Sha1sum (hex)
0978d23da4dad02afa585b127870c566836294ca
Title
janet.jpg
FileName
laura.jpg
Format
Sha1sum (hex)
a938e380e798d8cf0a7f5bb9305ea74a870e292e
Title
laura.jpg
FileName
margaret.jpg
Format
Sha1sum (hex)
be8a7e398df569e2a0fe0071543e90eef30077ce
Title
margaret.jpg
FileName
michael.jpg
Format
Sha1sum (hex)
db4caa9067579e36a2ff973370763b862be32b4a
Title
michael.jpg
FileName
nancy.jpg
Format
Sha1sum (hex)
35fd362792e8c4bc3560a6de02f25ee551d68d02
Title
nancy.jpg
FileName
robert.jpg
Format
Sha1sum (hex)
0040f22788c8513a2c622f67a0ab231cde61b96b
Title
robert.jpg
Category variable name
employeeName
Chart type
Series variable name
totalSales
Title
Sales by employee
Text
PREFIX schema: <https://schema.org/>

SELECT ?employeeName (SUM(?sale) AS ?totalSales)
WHERE {
    GRAPH ?orderGraph {
        ?order schema:broker ?employee ;
               schema:orderedItem ?orderItem .
        ?orderItem schema:price ?sale .
    }
    GRAPH ?employeeGraph {
        ?employee schema:givenName ?givenName ;
                  schema:familyName ?familyName .
        BIND(CONCAT(?givenName, " ", ?familyName) AS ?employeeName)
    }
}
GROUP BY ?employee ?employeeName
ORDER BY DESC(?totalSales)
Title
Sales by employee
Text
PREFIX  schema: <https://schema.org/>

  SELECT DISTINCT  ?employee
  WHERE
    { GRAPH ?doc
        { ?employee  a                 schema:Person ;
                    schema:familyName  ?lastName
          OPTIONAL
            { ?employee  schema:areaServed  ?territory }
          OPTIONAL
            { ?employee  schema:sponsor  ?reportsToEmployee }
          FILTER NOT EXISTS { GRAPH ?supplierGraph
                                { ?supplier  a               schema:Corporation ;
                                            schema:employee  ?employee
                                }
                            }
        }
    }
  ORDER BY ?lastName
Title
Select employees
FileName
steven.jpg
Format
Sha1sum (hex)
97d5bd0f95a59e38564302c49a188041697e8fe2
Title
steven.jpg