<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rdf:RDF [
    <!ENTITY rdf   "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <!ENTITY rdfs  "http://www.w3.org/2000/01/rdf-schema#">
    <!ENTITY owl   "http://www.w3.org/2002/07/owl#">
    <!ENTITY xsd   "http://www.w3.org/2001/XMLSchema#">
    <!ENTITY sswap "http://sswapmeet.sswap.info/sswap/">
]>

<rdf:RDF
    xmlns:rdf   = "&rdf;"
    xmlns:rdfs  = "&rdfs;"
    xmlns:owl   = "&owl;"
    xmlns:xsd   = "&xsd;"
    xmlns:sswap = "&sswap;"
    xmlns       = "&sswap;"
>

    <!-- Read in the SSWAP protocol to define all SSWAP terms -->
    <owl:Ontology rdf:about="&sswap;owlOntology">
        <owl:imports rdf:resource="&sswap;owlOntology"/>
    </owl:Ontology>

    <!-- Define this term using OWL + SSWAP semantics -->
    <owl:Class rdf:about="&sswap;Subject">

        <!-- Declare simple subsumption relations -->
        <rdfs:subClassOf rdf:resource="&sswap;SSWAP"/>

        <!-- Declare necessary conditions (i.e., subClassOf ) -->
        <!--
             These are essentially *optional* properties, so an
             individual may belong to this class and not have
             these properties instantiated.

             The cardinality constraints do not constrain how many
             instances of the property can exist, but it does allow
             a reasoner to infer how many semantically distinct
             objects (values) exist.  In the case of an
             owl:DatatypeProperty and an owl:maxCardinality = 1,
             it essentially means that if a value is defined, then
             it is the only allowed valued.  (Two semantically
             distinct values [e.g., 1 and 2] would yield the
             ontology inconsistent.
        -->
        <rdfs:subClassOf>
            <owl:Restriction>
                <owl:onProperty>
                    <owl:DatatypeProperty rdf:about="&sswap;metadata"/>
                </owl:onProperty>
                <owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:maxCardinality>
            </owl:Restriction>
        </rdfs:subClassOf>

        <rdfs:subClassOf>
            <owl:Restriction>
                <owl:onProperty>
                    <owl:ObjectProperty rdf:about="&sswap;mapsTo"/>
                </owl:onProperty>
                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">0</owl:minCardinality>
            </owl:Restriction>
        </rdfs:subClassOf>

        <!-- Declare necessary and sufficient conditions (i.e., equivalentClass) -->
        <!--
             These are essentially *required* properties, an individual must
             satisfy these conditions in order to belong to this class.
        -->
        <owl:equivalentClass>
            <owl:Restriction>
                <owl:onProperty>
		        <owl:ObjectProperty rdf:about="&sswap;mapsTo"/>
                </owl:onProperty>
                <owl:allValuesFrom>
                    <owl:Class rdf:about="&sswap;Object"/>
                </owl:allValuesFrom>
            </owl:Restriction>
        </owl:equivalentClass>

        <!-- Self-documenting comment about this term -->
        <rdfs:comment rdf:datatype="&xsd;string"
            >A required class. In the concept of a service mapping an input to an output, the sswap:Subject corresponds to the input. The property sswap:mapsTo explicitly demarcates the mapping (or transformation) from this input to its output. One can also use sswap:mapsTo to describe inverse mappings where the stated relationship is *from* a sswap:Object to a sswap:Subject.

Required predicates:
	&lt;none&gt;

Optional predicates:
	mapsTo
	metadata

While the sswap:mapsTo predicate is not strictly required, there must be at least one mapsTo relation from either a sswap:Subject to a sswap:Object or a sswap:Object to a sswap:Subject (designating an inverse mapping).  In most cases, services will use the former to express their mapping.

SSWAP classes use recognizable patterns to express required and optional predicates. Basically, cardinality constraints on predicates within an owl:equivalentClass block describe required predicates, while the same inside rdfs:subClassOf blocks describe optional predicates. This model can be used by any service in its own Resource Description Graph to express required and optional arguments.  For a full discussion please see http://sswap.info/protocol?selected=parametersDoc.

</rdfs:comment>

    </owl:Class>

</rdf:RDF>
