# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2024-2026 The Enola <https://enola.dev> Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# TODO Load full https://raw.githubusercontent.com/schemaorg/schemaorg/main/data/schema.ttl ?!
# (For speed, this will require implementing caching in OkHttpResource and switching to it instead of UrlResource;
#  among possibly a bit more other work; incl. implementing ORIGIN merging in class ThingMerger, etc.)

@prefix : <https://schema.org/> .
@prefix dc: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

:identifier a rdf:Property ;
  rdfs:label "identifier" ;
  :domainIncludes :Thing ;
  :rangeIncludes :PropertyValue,
                   :Text,
                   :URL ;
  rdfs:comment """The identifier property represents any kind of identifier for any kind of Thing, such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links.""" ;
  owl:equivalentProperty dc:identifier .

:name a rdf:Property ;
  rdfs:label "name" ;
  :domainIncludes :Thing ;
  :rangeIncludes :Text ;
  rdfs:comment "The name of the item." ;
  rdfs:subPropertyOf rdfs:label ;
  owl:equivalentProperty dc:title .

:description a rdf:Property ;
  rdfs:label "description" ;
  :domainIncludes :Thing ;
  :rangeIncludes :Text,
                   :TextObject ;
  rdfs:comment "A description of the item." ;
  owl:equivalentProperty dc:description .

:image a rdf:Property ;
  rdfs:label "image" ;
  :domainIncludes :Thing ;
  :rangeIncludes :ImageObject,
                   :URL ;
  rdfs:comment "An image of the item. This can be a [[URL]] or a fully described [[ImageObject]]." .

:URL a rdfs:Class ;
  rdfs:label "URL" ;
  rdfs:comment "Data type: URL." ;
  rdfs:subClassOf :Text .

:url a rdf:Property ;
  rdfs:label "url" ;
  :domainIncludes :Thing ;
  :rangeIncludes :URL ;
  rdfs:comment "URL of the item." .

:urlTemplate a rdf:Property ;
  rdfs:label "urlTemplate" ;
  :domainIncludes :EntryPoint ;
  :rangeIncludes :Text ;
  rdfs:comment "An url template (RFC6570) that will be used to construct the target of the execution of the action." .

:sameAs a rdf:Property ;
  rdfs:label "sameAs" ;
  :domainIncludes :Thing ;
  :rangeIncludes :URL ;
  rdfs:comment "URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website." .
