@prefix tool:   <https://eosc-data-commons.github.io/toolmeta-vocab/toolmeta#> .
@prefix schema: <https://schema.org/> .
@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 xsd:    <http://www.w3.org/2001/XMLSchema#> .
@prefix dcterms:<http://purl.org/dc/terms/> .

################################################################################
# Ontology header
################################################################################

tool: a owl:Ontology ;
  rdfs:label "ToolMeta Vocabulary"@en ;
  rdfs:comment "A minimal vocabulary for describing executable tool artefacts and their tool interfaces (inputs/outputs) in RDF/JSON-LD graphs."@en ;
  owl:versionIRI <https://eosc-data-commons.github.io/toolmeta-vocab/toolmeta/toolmeta.ttl> ;
  owl:versionInfo "0.1.0alpha" ;
  dcterms:license <https://creativecommons.org/licenses/by/4.0/> ;
  dcterms:creator "EOSC Data Commons project"@en ;
  dcterms:issued "2026-02-22"^^xsd:date .

################################################################################
# Core class: Tool Interface
################################################################################

tool:Interface a rdfs:Class ;
  rdfs:label "Tool Interface"@en ;
  rdfs:comment "Explicit description of a tool's operational interface, including its inputs and outputs."@en .

################################################################################
# Archetype classes (attach via @type on schema:SoftwareApplication)
################################################################################

tool:GalaxyWorkflow a rdfs:Class ;
  rdfs:subClassOf schema:SoftwareApplication ;
  rdfs:label "Galaxy Workflow"@en .

tool:GalaxyTool a rdfs:Class ;
  rdfs:subClassOf schema:SoftwareApplication ;
  rdfs:label "Galaxy Tool"@en .

tool:Notebook a rdfs:Class ;
  rdfs:subClassOf schema:SoftwareApplication ;
  rdfs:label "Notebook"@en .

tool:Container a rdfs:Class ;
  rdfs:subClassOf schema:SoftwareApplication ;
  rdfs:label "Container"@en .

tool:WebAPI a rdfs:Class ;
  rdfs:subClassOf schema:SoftwareApplication ;
  rdfs:label "Web API"@en .

################################################################################
# Artefact ↔ Interface linking
################################################################################

tool:hasInterface a rdf:Property ;
  rdfs:label "has interface"@en ;
  rdfs:domain schema:SoftwareApplication ;
  rdfs:range tool:Interface .

tool:interfaceVersion a rdf:Property ;
  rdfs:label "interface version"@en ;
  rdfs:domain tool:Interface ;
  rdfs:range xsd:string .

################################################################################
# Interface I/O properties
################################################################################

tool:hasInput a rdf:Property ;
  rdfs:label "has input"@en ;
  rdfs:domain tool:Interface ;
  rdfs:range schema:FormalParameter .

tool:hasOutput a rdf:Property ;
  rdfs:label "has output"@en ;
  rdfs:domain tool:Interface ;
  rdfs:range schema:FormalParameter .

################################################################################
# Input Type Classification (class-based, no strings)
################################################################################

tool:InputType a rdfs:Class ;
  rdfs:label "Input Type"@en ;
  rdfs:comment "Superclass for semantic classifications of tool input and output parameters."@en .

tool:inputType a rdf:Property ;
  rdfs:label "input type"@en ;
  rdfs:domain schema:FormalParameter ;
  rdfs:range tool:InputType .

################################################################################
# Core Input Type Hierarchy
################################################################################

tool:FileType a rdfs:Class ;
  rdfs:subClassOf tool:InputType ;
  rdfs:label "File Type"@en .

tool:FolderType a rdfs:Class ;
  rdfs:subClassOf tool:InputType ;
  rdfs:label "Folder Type"@en .

tool:IntegerType a rdfs:Class ;
  rdfs:subClassOf tool:InputType ;
  rdfs:label "Integer Type"@en .

tool:StringType a rdfs:Class ;
  rdfs:subClassOf tool:InputType ;
  rdfs:label "String Type"@en .

tool:BooleanType a rdfs:Class ;
  rdfs:subClassOf tool:InputType ;
  rdfs:label "Boolean Type"@en .

tool:DateTimeType a rdfs:Class ;
  rdfs:subClassOf tool:InputType ;
  rdfs:label "DateTime Type"@en .

################################################################################
# Optional parameter semantics
################################################################################

tool:role a rdf:Property ;
  rdfs:label "role"@en ;
  rdfs:comment "Semantic role of a parameter in the interface (e.g., primary, configuration, reference)."@en ;
  rdfs:domain schema:FormalParameter ;
  rdfs:range xsd:string .

################################################################################
# Optional file-related constraints
################################################################################

tool:fileExtension a rdf:Property ;
  rdfs:label "file extension"@en ;
  rdfs:comment "Expected file extension for a file parameter."@en ;
  rdfs:domain schema:FormalParameter ;
  rdfs:range xsd:string .

################################################################################
# Embedded schema constraints
################################################################################

tool:schemaType a rdf:Property ;
  rdfs:domain schema:FormalParameter ;
  rdfs:range xsd:string .

tool:schemaVersion a rdf:Property ;
  rdfs:domain schema:FormalParameter ;
  rdfs:range xsd:string .

tool:schema a rdf:Property ;
  rdfs:domain schema:FormalParameter .

################################################################################
# Harvested metadata tracking
################################################################################

tool:rawMetadata a rdf:Property ;
  rdfs:label "raw metadata"@en ;
  rdfs:domain schema:SoftwareApplication ;
  rdfs:range rdf:JSON .

tool:metadataType a rdf:Property ;
  rdfs:domain schema:SoftwareApplication ;
  rdfs:range xsd:string .

tool:metadataVersion a rdf:Property ;
  rdfs:domain schema:SoftwareApplication ;
  rdfs:range xsd:string .
