PREFIX foaf: PREFIX dct: PREFIX schema: CONSTRUCT { GRAPH ?graph { ?graph dct:title ?categoryName ; foaf:primaryTopic ?category . ?category a schema:ProductGroup ; dct:title ?categoryName ; dct:description ?description ; schema:name ?categoryName ; schema:identifier ?categoryID ; schema:description ?description ; foaf:depiction ?picture . } } WHERE { ?category_row <#categoryID> ?categoryID ; <#description> ?description ; <#categoryName> ?categoryName ; <#pictureHash> ?pictureHash . BIND(uri(concat(str($base), "categories/")) AS ?container) BIND(uri(concat(str(?container), encode_for_uri(?categoryID), "/")) AS ?graph) BIND(uri(concat(str(?graph), "#this")) AS ?category) BIND(uri(concat(str($base), "uploads/", encode_for_uri(?pictureHash))) AS ?picture) }