PREFIX pattern: <http://www.essepuntato.it/2008/12/pattern#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

pattern:Bucket a rdfs:Class ;
  rdfs:label "bucket element"@en ;
  rdfs:comment "The class of elements that can contain other elements but no text nodes."@en ;
  rdfs:subClassOf pattern:NonTextual , pattern:Structured .

pattern:contains a rdf:Property ;
  rdfs:label "contains"@en ;
  rdfs:comment "A structured element contains another generic element."@en ;
  rdfs:domain pattern:Structured ;
  rdfs:range <https://w3id.org/linkml/Any> .

pattern:canContainHeteronymousElements a rdf:Property ;
  rdfs:label "can contain heteronymous elements"@en ;
  rdfs:comment "A hierarchical-based entity contains al least two entities having different names."@en ;
  rdfs:domain pattern:Structured ;
  rdfs:range xsd:boolean .

pattern:canContainHomonymousElements a rdf:Property ;
  rdfs:label "can contain homonymous elements"@en ;
  rdfs:comment "A hierarchical-based entity contains al least two entities that share the same name."@en ;
  rdfs:domain pattern:Structured ;
  rdfs:range xsd:boolean .

pattern:Atom a rdfs:Class ;
  rdfs:label "atom element"@en ;
  rdfs:comment "This class is defined to describe literal text that is part of the document body. Moreover, similarly to Inline, elements following the Atom pattern can only be contained within block or inline elements (and consequently they also cannot be used as root elements of documents). It can contain textual content and no other elements."@en .

pattern:isContainedBy a rdf:Property ;
  rdfs:label "is contained by"@en ;
  rdfs:comment "An element that is contained by another structured element."@en ;
  rdfs:range <https://w3id.org/linkml/Any> .

pattern:Flat a rdfs:Class ;
  rdfs:label "flat element"@en ;
  rdfs:comment "The class of elements that can contain text nodes but no elements."@en ;
  rdfs:subClassOf pattern:NonStructured , pattern:Textual .

pattern:Pattern a rdfs:Class ;
  rdfs:label "pattern-based element"@en ;
  rdfs:comment """A structural pattern is an atomic component of a document, that is able to capture a recurrent and well knwon structure of a document.

Any entity belonging to this class is compliant with exactly one structural pattern."""@en .

<http://www.w3.org/2003/11/swrl#Variable> a rdfs:Class .

pattern:Inline a rdfs:Class ;
  rdfs:label "inline element"@en ;
  rdfs:comment """This class has the same use and content model of the pattern Block, but differing primarily because a) inline elements can contain other elements compliant with the same pattern while block elements cannot, and b) inline elements must always be contained by other block or inline elements and by no other type of element.

These constraints also imply that inline elements cannot be used as root elements of documents and that the class Block is disjoint with the class Inline (i.e., a markup element cannot be a block and an inline at the same time)."""@en .

pattern:Meta a rdfs:Class ;
  rdfs:label "meta element"@en ;
  rdfs:comment "This class describes elements that contain neither other elements nor textual content. Contrarily to the pattern Milestone, which was meant to describe markup elements that impact the document because of their location, the main feature of its disjoint sibling is the mere existence, independently from the position it has within the document. Meta elements convey metadata information about the document or part of it, independently of where they are. Thus, meta elements can be contained only within container elements."@en .

pattern:Container a rdfs:Class ;
  rdfs:label "container element"@en ;
  rdfs:comment "This class concerns the structural organization of a document. Elements following this pattern contain no textual content and contain only elements compliant with the patterns: Meta, Field, Block and any subtype of Container. It is disjointed with the pattern Popup, although they share the same content model."@en .

pattern:Popup a rdfs:Class ;
  rdfs:label "popup element"@en ;
  rdfs:comment "This class defines bucket elements that are only present within block and inline elements. Popup elements are used whenever complex structures need to be placed within content elements such as paragraphs. "@en .

pattern:Structured a rdfs:Class ;
  rdfs:label "structured element"@en ;
  rdfs:comment "The class of elements that can contain other elements."@en ;
  rdfs:subClassOf pattern:Pattern .

pattern:Record a rdfs:Class ;
  rdfs:label "record element"@en ;
  rdfs:comment "This class describes container elements that can only contain heterogeneous and non repeatable elements."@en .

pattern:Table a rdfs:Class ;
  rdfs:label "table element"@en ;
  rdfs:comment "This class describes container elements that must contain only homogeneous elements (but they can be repeated)."@en .

pattern:NonTextual a rdfs:Class ;
  rdfs:label "non-textual element"@en ;
  rdfs:comment "The class of elements that cannot have textual content in their content models."@en ;
  rdfs:subClassOf pattern:Pattern .

pattern:Milestone a rdfs:Class ;
  rdfs:label "milestone element"@en ;
  rdfs:comment """This class describe elements that contain neither other elements nor textual content. Moreover, similarly to Inline, elements following the Milestone pattern can only be contained within block or inline elements (and consequently they also cannot be used as root elements of documents).

The distinctive characteristic of the pattern Milestone is the location it assumes within the document."""@en .

pattern:NonStructured a rdfs:Class ;
  rdfs:label "non-structured element"@en ;
  rdfs:comment "The class of elements that cannot contain other elements."@en ;
  rdfs:subClassOf pattern:Pattern .

pattern:Marker a rdfs:Class ;
  rdfs:label "marker element"@en ;
  rdfs:comment "The class of elements that can contain neither text nodes nor elements."@en ;
  rdfs:subClassOf pattern:NonStructured , pattern:NonTextual .

pattern:Field a rdfs:Class ;
  rdfs:label "field element"@en ;
  rdfs:comment "This class is defined to describe literal metadata or text that is not really part of the document body, contrarily to its disjointed sibling Atom. Its main difference with Meta is that Field can contain textual content."@en .

pattern:Mixed a rdfs:Class ;
  rdfs:label "mixed element"@en ;
  rdfs:comment "The class of elements that can contain other elements and text nodes."@en ;
  rdfs:subClassOf pattern:Structured , pattern:Textual .

pattern:HeadedContainer a rdfs:Class ;
  rdfs:label "headed-container element"@en ;
  rdfs:comment "This class describes container elements whose content model need to begin with one or more block elements (the heading), specified through the property containsAsHeader."@en .

pattern:containsAsHeader a rdf:Property ;
  rdfs:label "contains as header"@en ;
  rdfs:comment "A structured element contains another generic element as part of its header."@en ;
  rdfs:domain pattern:Structured ;
  rdfs:range pattern:Block ;
  rdfs:subPropertyOf pattern:contains .

pattern:Block a rdfs:Class ;
  rdfs:label "block element"@en ;
  rdfs:comment "This class organise the document content as a sequence of nestable elements and text nodes. In particular, elements following this pattern can contain text and other elements compliant with the patterns Inline, Atom, Milestones and Popup, which will be introduced in the following. Furthermore, it is a requirement that block elements are contained only by container and popup elements"@en .

<https://w3id.org/linkml/Any> a rdfs:Class ;
  rdfs:comment "An unconstrained type or object"@en .

pattern:Textual a rdfs:Class ;
  rdfs:label "textual element"@en ;
  rdfs:comment "The class of elements that can have textual content in their content models."@en ;
  rdfs:subClassOf pattern:Pattern .

pattern:hasName a rdf:Property ;
  rdfs:label "has name"@en ;
  rdfs:comment "The name of a particular element."@en ;
  rdfs:range xsd:string .

pattern:isContainedByAsHeader a rdf:Property ;
  rdfs:label "is contained by as header"@en ;
  rdfs:comment "An element is contained by another structured element as part of its header."@en ;
  rdfs:range xsd:string ;
  rdfs:subPropertyOf pattern:isContainedBy .
