@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:    <http://www.w3.org/2002/07/owl#> .
@prefix sh:     <http://www.w3.org/ns/shacl#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix schema: <http://schema.org/> .
@prefix foaf:   <http://xmlns.com/foaf/0.1/> .
@prefix locn:   <http://www.w3.org/ns/locn#> .
@prefix qudt:   <http://qudt.org/schema/qudt/> .
@prefix eprel:  <../vocab#> .
@prefix :       <common.shapes.ttl#> .

# Shapes shared by several data documents: quantities, addresses, file
# descriptions. Used only for nesting, so none of them has a sh:targetClass.
#
# Labels: terms coined by this wrapper are labelled in ../vocab; sh:name appears
# here only for terms of external vocabularies (locn:, schema:, foaf:), which
# carry no labels in the documents the viewer loads, and for keys EPREL adds
# that the wrapper passes through uncurated.

<> a foaf:Document ;
    rdfs:label "Linked EPREL shapes: common"@en , "Linked-EPREL-Shapes: gemeinsam"@de ;
    owl:imports <../vocab> .

# ---- Quantities ---------------------------------------------------------

:QuantityValueShape
    a sh:NodeShape ;
    sh:property [
        sh:path qudt:numericValue ;
        sh:name "Value"@en , "Wert"@de ;
        sh:minCount 1 ;
        sh:order 1
    ] , [
        sh:path qudt:unit ;
        sh:name "Unit"@en , "Einheit"@de ;
        sh:minCount 1 ;
        sh:order 2
    ] , [
        sh:path eprel:unitInferred ;
        sh:order 3
    ] .

# ---- Addresses (contactDetails) -----------------------------------------

:AddressShape
    a sh:NodeShape ;
    sh:property [
        sh:path locn:thoroughfare ;
        sh:name "Street"@en , "Straße"@de ;
        sh:order 1
    ] , [
        sh:path locn:locatorDesignator ;
        sh:name "House number"@en , "Hausnummer"@de ;
        sh:order 2
    ] , [
        sh:path locn:postCode ;
        sh:name "Postcode"@en , "Postleitzahl"@de ;
        sh:order 3
    ] , [
        sh:path locn:postName ;
        sh:name "City"@en , "Ort"@de ;
        sh:order 4
    ] , [
        sh:path eprel:municipality ;
        sh:name "Municipality"@en , "Gemeinde"@de ;
        sh:order 5
    ] , [
        sh:path locn:adminUnitL2 ;
        sh:name "Province"@en , "Provinz"@de ;
        sh:order 6
    ] , [
        sh:path locn:adminUnitL1 ;
        sh:name "Country"@en , "Land"@de ;
        sh:order 7
    ] , [
        sh:path schema:email ;
        sh:name "Email"@en , "E-Mail"@de ;
        sh:order 8
    ] , [
        sh:path schema:telephone ;
        sh:name "Telephone"@en , "Telefon"@de ;
        sh:order 9
    ] , [
        sh:path foaf:page ;
        sh:name "Service website"@en , "Service-Website"@de ;
        sh:description "The contact's website, which is often the supplier's service page rather than its homepage."@en ;
        sh:order 10
    ] , [
        sh:path eprel:serviceName ;
        sh:name "Service name"@en , "Name der Stelle"@de ;
        sh:order 11
    ] , [
        sh:path eprel:contactReference ;
        sh:name "Contact reference"@en , "Kontaktbezeichnung"@de ;
        sh:order 12
    ] .

# ---- Files --------------------------------------------------------------

# An energy label PDF or image, served by the wrapper at product/{id}/label.{ext}.
:DistributionShape
    a sh:NodeShape ;
    sh:property [
        sh:path dcterms:identifier ;
        sh:name "File name"@en , "Dateiname"@de ;
        sh:order 1
    ] .

# A file EPREL names but does not serve (spectralPowerDistributionImage).
:ImageObjectShape
    a sh:NodeShape ;
    sh:property [
        sh:path schema:name ;
        sh:name "File name"@en , "Dateiname"@de ;
        sh:order 1
    ] , [
        sh:path schema:contentSize ;
        sh:name "File size (bytes)"@en , "Dateigröße (Bytes)"@de ;
        sh:order 2
    ] .
