@prefix dc11: <http://purl.org/dc/elements/1.1/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ns0: <http://www.w3.org/ns/ui#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<http://njh.me/>
  dc11:author <https://www.w3.org/People/Berners-Lee/card#i> ;
  dc11:created "2010-08-07"^^xsd:date ;
  dc11:description """The User Interface ontology allows the definition
	of forms for processing RDF model data, and include a bootstrap form for
	editing forms. It allows user interface hints such as background colors,
	can be associated with objects and classes.
	""" ;
  dc11:license <https://creativecommons.org/publicdomain/zero/1.0/> ;
  dc11:modified "$Date: 2020/03/22 16:53:21 $" ;
  dc11:title "An ontology for User Interface description, Hints and Forms." .

<http://www.w3.org/ns/ui#BooleanField> rdfs:subClassOf <http://www.w3.org/ns/ui#NumericField> .
<http://www.w3.org/ns/ui#CaseForm>
  a <http://www.w3.org/ns/ui#Group> ;
  dc11:title "Form for a conditional case in a form" ;
  ns0:parts (
   _:genid2
   _:genid4
 ) .

ns0:Choice rdfs:subClassOf ns0:Form, ns0:Single .
ns0:Classifier
  a rdfs:Class ;
  rdfs:comment """A classifier allows the user to select the type of an object.
    The possible types must be subclasses of some overall class, the "category".
    (Ideally, the superclass is also set up as the disjoint union of the subclasses,
    if they are disjoint.)

    The form normally stores the resulting classes using an rdf:type triple,
    but a different predicate can be used if required, so the classifier field
    needs is 'property' defined too.

    If the subclass selected itself is has subclasses defined, the user can
    recursively select from them in turn, as many levels as needed.""" ;
  rdfs:label "classifier" ;
  rdfs:subClassOf ns0:Form, ns0:Single .

ns0:ColorField rdfs:subClassOf ns0:ValueField .
ns0:Comment rdfs:subClassOf ns0:Form, ns0:Single .
ns0:DateField rdfs:subClassOf ns0:ValueField .
ns0:DateTimeField rdfs:subClassOf ns0:ValueField .
ns0:DecimalField rdfs:subClassOf ns0:NumericField .
ns0:EmailField rdfs:subClassOf ns0:ValueField .
ns0:FF1
  a ns0:Heading ;
  ns0:contents "Edit Form"@en ;
  ns0:sequence 1 .

ns0:FF2
  a ns0:SingleLineTextField ;
  ns0:property dc11:title ;
  ns0:sequence 2 ;
  ns0:size 60 .

ns0:FF3
  a ns0:Comment ;
  ns0:contents """To add a field to the form, press the plus at the bottom,
        and then select what sort of field you want."""@en ;
  ns0:sequence 3 ;
  ns0:style "background-color: #ffe;" .

ns0:FieldForm
  a ns0:Group ;
  dc11:title "Form for selecting a type of field" ;
  ns0:parts (
   _:genid6
   _:genid8
 ) .

ns0:FieldList
  a ns0:Multiple ;
  ns0:ordered ns0:true ;
  ns0:part ns0:FieldForm ;
  ns0:property ns0:parts ;
  ns0:sequence 10 .

ns0:FloatField rdfs:subClassOf ns0:NumericField .
ns0:Form
  a rdfs:Class ;
  rdfs:comment """A form can be any type of single field, or typically a Group of several fields,
    including interspersed headings and comments.  """ ;
  owl:disjointUnionOf (
   ns0:ValueField
   ns0:Group
   ns0:Choice
   ns0:Classifier
   ns0:Options
   ns0:Multiple
   ns0:Heading
   ns0:Comment
 ) ;
  ns0:creationForm ns0:FormForm .

ns0:FormForm
  a ns0:Form, ns0:Group ;
  dc11:title "Form for editing Forms" ;
  ns0:parts (
   ns0:FF1
   ns0:FF2
   ns0:FF3
   ns0:FieldList
 ) .

ns0:Group rdfs:subClassOf ns0:Form, ns0:Single .
ns0:Heading rdfs:subClassOf ns0:Form, ns0:Single .
ns0:IntegerField rdfs:subClassOf ns0:NumericField .
ns0:MultiLineTextField rdfs:subClassOf ns0:TextField .
ns0:Multiple rdfs:subClassOf ns0:Form .
ns0:NumericField
  a rdfs:Class ;
  rdfs:subClassOf ns0:ValueField ;
  owl:disjointUnionOf (
   ns0:BooleanField
   ns0:TriStateField
   ns0:IntegerField
   ns0:DecimalField
   ns0:FloatField
 ) .

ns0:Options rdfs:subClassOf ns0:Form, ns0:Single .
ns0:PhoneField rdfs:subClassOf ns0:ValueField .
ns0:Single
  a rdfs:Class ;
  owl:disjointUnionOf (
   ns0:ValueField
   ns0:Group
   ns0:Choice
   ns0:Classifier
   ns0:Options
   ns0:Heading
   ns0:Comment
 ) .

ns0:SingleLineTextField rdfs:subClassOf ns0:TextField .
ns0:TextField
  a rdfs:Class ;
  rdfs:subClassOf ns0:ValueField ;
  owl:disjointUnionOf (
   ns0:SingleLineTextField
   ns0:MultiLineTextField
 ) .

ns0:TriStateField rdfs:subClassOf ns0:NumericField .
ns0:ValueField
  a rdfs:Class ;
  rdfs:subClassOf ns0:Form, ns0:Single ;
  owl:disjointUnionOf (
   ns0:TextField
   ns0:NumericField
   ns0:ColorField
   ns0:DateField
   ns0:DateTimeField
   ns0:PhoneField
   ns0:EmailField
 ) .

ns0:annotationForm
  a rdf:Property ;
  rdfs:comment """A form which may be used to add more infromation to an
instance of this class which we know something about.  Anything from
adding just add one more fact, to adding a whole lot of information about a specific
facet of the thing.
""" ;
  rdfs:domain rdfs:Class ;
  rdfs:label "annotation form" ;
  rdfs:range ns0:Form .

ns0:backgroundColor
  a rdf:Property, owl:DatatypeProperty ;
  rdfs:comment """Must be a valid CSS color string such as one could put in
        an HTML style attribute.  This should be in the #xxxxxx form,
        (with 6 digits of hex)  so that it
        can work with Graphviz.""" ;
  rdfs:label "background color"@en ;
  rdfs:range ns0:Color .

ns0:backgroundImage
  a rdf:Property, owl:DatatypeProperty ;
  rdfs:comment "URI or base64 representation of an image" ;
  rdfs:label "background image"@en .

ns0:category
  a rdf:Property ;
  rdfs:comment "The superclass subclasses of which will be selected." ;
  rdfs:domain ns0:Classifier ;
  rdfs:label "overall superclass"@en ;
  rdfs:range rdfs:Class .

ns0:color
  a rdf:Property, owl:DatatypeProperty ;
  rdfs:comment """Must be a valid CSS color string such as one could put in
        an HTML style attribute.  This should be in the #xxxxxx form,
        (with 6 digits of hex)  so that it
        can work with Graphviz.""" ;
  rdfs:label "color"@en ;
  rdfs:range ns0:Color .

ns0:creationForm
  a rdf:Property ;
  rdfs:comment """A form which may be used to collect information about a
    hitherto locally undocumented instance instance of this class.""" ;
  rdfs:domain rdfs:Class ;
  rdfs:label "creation form" ;
  rdfs:range ns0:Form .

ns0:dependingOn
  a rdf:Property ;
  rdfs:comment "Many fields prompt for information about a given property of the subject" ;
  rdfs:domain ns0:Options ;
  rdfs:label "depending on"@en ;
  rdfs:range rdf:Property .

ns0:for
  a rdf:Property ;
  rdfs:comment "The value for which this case is selected." ;
  rdfs:label "for"@en .

ns0:from
  a rdf:Property ;
  rdfs:domain ns0:Choice ;
  rdfs:label "from" ;
  rdfs:range rdf:Class ;
  ns0:prompt "from what class" .

ns0:initialProperties
  a rdf:Property ;
  rdfs:comment """A really simple way of enabling user interfaces to
            create new information about a class of things is to make a define of properties
            to be specified when a information about a new item
            ("New item" here means an item which the system
            does not have prvious information about yet,
            not an items which has just been created,
            like new friend as opposed to new baby)""" ;
  rdfs:domain rdfs:Class ;
  rdfs:label "initial properties" ;
  rdfs:range rdf:List ;
  ns0:prompt "Properties to be specified for new ones" .

ns0:maxLength
  a rdf:Property ;
  rdfs:domain ns0:TextField ;
  rdfs:label "max length of value" ;
  rdfs:range xsd:integer .

ns0:maxValue
  a rdf:Property ;
  rdfs:domain ns0:ValueField ;
  rdfs:label "max" .

ns0:minValue
  a rdf:Property ;
  rdfs:domain ns0:ValueField ;
  rdfs:label "min" .

ns0:ordered
  rdfs:label "ordered" ;
  rdfs:range xsd:Boolean ;
  ns0:e rdf:Property .

ns0:part
  a rdf:Property ;
  rdfs:domain ns0:Form ;
  rdfs:label "part"@en ;
  rdfs:range ns0:Form .

ns0:parts
  a rdf:Property ;
  rdfs:domain ns0:Form ;
  rdfs:label "parts"@en ;
  rdfs:range rdf:Collection .

ns0:prompt
  a rdf:Property ;
  rdfs:comment """A string for the UI to use if the user needs a longer
        prompts than just a field name, the rdfs:label. """ ;
  rdfs:label "user prompt" ;
  ns0:prompt "A longer prompt for a user inputting this property" .

ns0:property
  a rdf:Property ;
  rdfs:comment """Many fields prompt for information about a given property of the subject.
    When field is filled in, this gives which property is written into the data.""" ;
  rdfs:domain ns0:Form ;
  rdfs:label "property to be stored"@en ;
  rdfs:range rdf:Property .

ns0:seqeunce
  a rdf:Property ;
  rdfs:comment "The sequence in which this item is arranged with repect to other parts." ;
  rdfs:label "sequence number" ;
  rdfs:range xsd:integer .

ns0:size
  a rdf:Property ;
  rdfs:domain ns0:ValueField ;
  rdfs:label "size of field" ;
  rdfs:range xsd:integer ;
  ns0:prompt "size of field in characters" .

ns0:sortBy
  a rdf:Property ;
  rdfs:comment """A property which typically is used to sort
        members of a given class.""" ;
  rdfs:domain rdfs:Class ;
  rdfs:label "sort by" ;
  rdfs:range rdf:Property .

ns0:sortPriority
  a rdf:Property, owl:DatatypeProperty ;
  rdfs:comment """When individuals or classes must be sorted, then
        if they are given different values of sortPriority a user agent can
        use this as a hint to how to present information.""" ;
  rdfs:label "sort priority" ;
  rdfs:range xsd:integer .

ns0:style
  a rdf:Property, owl:DatatypeProperty ;
  rdfs:comment """Must be a valid CSS style string such as one could put in
        an HTML style attribute.  Depending on the user interface system, this can
        by given to individuals, classes or properties. It is up to a user interface
        which wants to draw on them to pick how it uses styles from which parts
        of the data it has.  For example, the style of a class may be picked
        to distinguish information about things in that class.""" ;
  rdfs:label "style" ;
  ns0:prompt "CSS style" .

ns0:tableProperties
  a rdf:Property ;
  rdfs:comment """This  is a crude way of specifying a table-based
            view for objects of this class.""" ;
  rdfs:domain rdfs:Class ;
  rdfs:label "table properties" ;
  rdfs:range rdf:List ;
  ns0:prompt "Properties to be given in a default table view" .

ns0:use
  a rdf:Property ;
  rdfs:range ns0:Form .

_:genid2
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from rdfs:Class ;
  ns0:label "when it is" ;
  ns0:property ns0:for ;
  ns0:sequence 1 .

_:genid4
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from ns0:Form ;
  ns0:property ns0:use ;
  ns0:sequence 2 ;
  ns0:use ns0:FieldForm .

_:genid6
  a ns0:Classifier ;
  ns0:category ns0:Form ;
  ns0:property rdf:type ;
  ns0:sequence 1 .

_:genid8
  a ns0:Options ;
  ns0:case [
    ns0:for ns0:TextField ;
    ns0:use [
      a ns0:Group ;
      ns0:parts (
       _:genid12
       _:genid14
       _:genid16
     )
    ]
  ], [
    ns0:for ns0:IntegerField ;
    ns0:use [
      a ns0:Group ;
      ns0:parts (
       _:genid20
       _:genid22
       _:genid24
     )
    ]
  ], [
    ns0:for ns0:DecimalField ;
    ns0:use [
      a ns0:Group ;
      ns0:parts (
       _:genid28
       _:genid30
       _:genid32
     )
    ]
  ], [
    ns0:for ns0:FloatField ;
    ns0:use [
      a ns0:Group ;
      ns0:parts (
       _:genid36
       _:genid38
       _:genid40
     )
    ]
  ], [
    ns0:for ns0:ColorField ;
    ns0:use [
      a ns0:Group ;
      ns0:parts ( _:genid44 )
    ]
  ], [
    ns0:for ns0:DateField ;
    ns0:use [
      a ns0:Group ;
      ns0:parts (
       _:genid48
       _:genid50
       _:genid52
     )
    ]
  ], [
    ns0:for ns0:DateTimeField ;
    ns0:use [
      a ns0:Group ;
      ns0:parts (
       _:genid56
       _:genid58
       _:genid60
     )
    ]
  ], [
    ns0:for ns0:EmailField ;
    ns0:use [
      a ns0:Group ;
      ns0:parts ( _:genid64 )
    ]
  ], [
    ns0:for ns0:PhoneField ;
    ns0:use [
      a ns0:Group ;
      ns0:parts ( _:genid68 )
    ]
  ], [
    ns0:for ns0:Group ;
    ns0:use ns0:FieldList
  ], [
    ns0:for ns0:Options ;
    ns0:use [
      a ns0:Group ;
      ns0:parts (
       _:genid73
       _:genid75
     )
    ]
  ], [
    ns0:for ns0:Choice ;
    ns0:use [
      a ns0:Group ;
      ns0:parts (
       _:genid79
       _:genid81
       _:genid83
       _:genid85
     )
    ]
  ], [
    ns0:for ns0:Classifier ;
    ns0:use [
      a ns0:Group ;
      ns0:parts (
       _:genid89
       _:genid91
       _:genid93
       _:genid95
     )
    ]
  ], [
    ns0:for ns0:Multiple ;
    ns0:use [
      a ns0:Group ;
      ns0:parts (
       _:genid99
       _:genid101
       _:genid103
       _:genid105
     )
    ]
  ], [
    ns0:for ns0:Heading ;
    ns0:use [
      a ns0:SingleLineTextField ;
      ns0:property ns0:contents
    ]
  ], [
    ns0:for ns0:Comment ;
    ns0:use [
      a ns0:MultiLineTextField ;
      ns0:property ns0:contents
    ]
  ] ;
  ns0:dependingOn rdf:type ;
  ns0:sequence 2 .

_:genid12
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from owl:DatatypeProperty ;
  ns0:label "property" ;
  ns0:property ns0:property .

_:genid14
  a ns0:IntegerField ;
  ns0:label "field size" ;
  ns0:max 4096 ;
  ns0:min 1 ;
  ns0:property ns0:size .

_:genid16
  a ns0:IntegerField ;
  ns0:label "Max. length of string" ;
  ns0:min 1 ;
  ns0:property ns0:maxLength .

_:genid20
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from owl:DatatypeProperty ;
  ns0:label "property" ;
  ns0:property ns0:property ;
  ns0:sequence 1 .

_:genid22
  a ns0:IntegerField ;
  ns0:label "minimum value" ;
  ns0:property ns0:min ;
  ns0:sequence 2 .

_:genid24
  a ns0:IntegerField ;
  ns0:label "maximum value" ;
  ns0:property ns0:max ;
  ns0:sequence 3 .

_:genid28
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from owl:DatatypeProperty ;
  ns0:label "property" ;
  ns0:property ns0:property ;
  ns0:sequence 1 .

_:genid30
  a ns0:DecimalField ;
  ns0:label "minimum value" ;
  ns0:property ns0:min ;
  ns0:sequence 2 .

_:genid32
  a ns0:DecimalField ;
  ns0:label "maximum value" ;
  ns0:property ns0:max ;
  ns0:sequence 3 .

_:genid36
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from owl:DatatypeProperty ;
  ns0:label "property" ;
  ns0:property ns0:property ;
  ns0:sequence 1 .

_:genid38
  a ns0:FloatField ;
  ns0:label "minimum value" ;
  ns0:property ns0:min ;
  ns0:sequence 2 .

_:genid40
  a ns0:FloatField ;
  ns0:label "maximum value" ;
  ns0:property ns0:max ;
  ns0:sequence 3 .

_:genid44
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from owl:DatatypeProperty ;
  ns0:label "property" ;
  ns0:property ns0:property ;
  ns0:sequence 1 .

_:genid48
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from owl:DatatypeProperty ;
  ns0:label "property" ;
  ns0:property ns0:property ;
  ns0:sequence 1 .

_:genid50
  a ns0:DateField ;
  ns0:label "min" ;
  ns0:property ns0:min ;
  ns0:sequence 2 .

_:genid52
  a ns0:DateField ;
  ns0:label "max" ;
  ns0:property ns0:max ;
  ns0:sequence 3 .

_:genid56
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from owl:DatatypeProperty ;
  ns0:label "property" ;
  ns0:property ns0:property ;
  ns0:sequence 1 .

_:genid58
  a ns0:DateTimeField ;
  ns0:label "min" ;
  ns0:property ns0:min ;
  ns0:sequence 2 .

_:genid60
  a ns0:DateTimeField ;
  ns0:label "max" ;
  ns0:property ns0:max ;
  ns0:sequence 3 .

_:genid64
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from owl:ObjectProperty ;
  ns0:label "property" ;
  ns0:property ns0:property ;
  ns0:sequence 1 .

_:genid68
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from owl:ObjectProperty ;
  ns0:label "property" ;
  ns0:property ns0:property ;
  ns0:sequence 1 .

_:genid73
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:default rdf:type ;
  ns0:from rdf:Property ;
  ns0:label "depending on" ;
  ns0:property ns0:dependingOn ;
  ns0:sequence 1 .

_:genid75
  a ns0:Multiple ;
  ns0:part ns0:CaseForm ;
  ns0:property ns0:case ;
  ns0:sequence 2 .

_:genid79
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from owl:ObjectProperty ;
  ns0:label "property" ;
  ns0:property ns0:property ;
  ns0:sequence 1 .

_:genid81
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from rdfs:Class ;
  ns0:label "destination class" ;
  ns0:property ns0:from ;
  ns0:sequence 2 .

_:genid83
  a ns0:BooleanField ;
  ns0:label "user can add new" ;
  ns0:property ns0:canMintNew ;
  ns0:sequence 3 .

_:genid85
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from ns0:Form ;
  ns0:label "Nested Form (if any)" ;
  ns0:optional ns0:true ;
  ns0:property ns0:use ;
  ns0:sequence 4 ;
  ns0:use ns0:FormForm .

_:genid89
  a ns0:Comment ;
  ns0:contents "A classifier allows the user to which classes the item belongs to, given a common superclass of the allowed classes.  Give the superclass here:" ;
  ns0:sequence 2 .

_:genid91
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from rdfs:Class ;
  ns0:label "superclass" ;
  ns0:property ns0:category ;
  ns0:sequence 4 .

_:genid93
  a ns0:Comment ;
  ns0:contents "(When the choice is made normally the item is given a rdf:type. Set this to rdf:type unless you want the form to set a different property.)" ;
  ns0:sequence 6 .

_:genid95
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:default rdf:type ;
  ns0:from owl:ObjectProperty ;
  ns0:label "property" ;
  ns0:property ns0:property ;
  ns0:sequence 8 .

_:genid99
  a ns0:BooleanField ;
  ns0:label "ordered" ;
  ns0:property ns0:ordered ;
  ns0:sequence 0 .

_:genid101
  a ns0:IntegerField ;
  ns0:label "minimum number" ;
  ns0:property ns0:min ;
  ns0:sequence 0 .

_:genid103
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from rdf:Property ;
  ns0:label "property" ;
  ns0:property ns0:property ;
  ns0:sequence 1 .

_:genid105
  a ns0:Choice ;
  ns0:canMintNew ns0:true ;
  ns0:from ns0:Form ;
  ns0:property ns0:part ;
  ns0:sequence 2 ;
  ns0:use ns0:FieldForm .
