Menu

Protocol-Subject

Damian Gessler
Attachments
SSWAProtocol-Subject.png (71536 bytes)

Subject


Provider      Resource      Graph      Subject      Object

Subject

In the concept of a service mapping an input to an output, the Subject corresponds to the input. The property sswap:mapsTo demarcates the mapping (or transformation) of the input to the output (Object). A Subject may be a blank node, whereby the "data" is serialized in the values of user-defined properties (ontology terms). Or it may be a URI, including a URL to where the data is located. The Subject may be typed with user-defined ontology types (OWL classes), or may have OWL ObjectProperties to extend arbitrary data structures, and/or OWL DatatypeProperties for literals.
Properties

sswap:mapsTo Required property that connects a Subject to an Object. Subjects may have multiple sswap:mapsTo predicates. For services, this is used to establish the transformation from the input to the output.

Examples: Building an RDG (Resource Description Graph)

1. The Resource canonicalResource has a sswap:operatesOn relationship to a Graph (a blank node), which has an sswap:hasMapping relationship to a Subject (a blank node), which in turn has a sswap:mapsTo relationship to an Object (a blank node). As a Resource Description Graph (RDG), it is saying that this resource maps "anything" — represented by the blank Subject node — to anything: the blank Object node. In actual RDGs, you will want to make more specific statements about your resource. For example by declaring that blank Subject/Object nodes belong to other classes and/or have other properties. In a Resource Invocation Graph (RIG), the Subject blank node is simply replaced by the actual resource containing the input data (i.e., a URL) or a blank node with a predicate set to the input value. In a Resource Response Graph (RRG), the Object is often similarly replaced with the URL of the output data or annotated with properties.

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

<rdf:RDF
  xmlns:rdf   = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:sswap = "http://sswapmeet.sswap.info/sswap/"
  >

  <sswap:Resource rdf:about="http://sswap.info/examples/resources/canonical/canonicalResource">

    <sswap:name>A canonical SSWAP web resource</sswap:name>

    <sswap:providedBy>
      <sswap:Provider rdf:about="http://sswap.info/examples/resourceProvider"/>
    </sswap:providedBy>

    <sswap:operatesOn>
      <sswap:Graph>
        <sswap:hasMapping>
          <sswap:Subject>
            <sswap:mapsTo>
              <sswap:Object/>
            </sswap:mapsTo>
          </sswap:Subject>
        </sswap:hasMapping>
      </sswap:Graph>
    </sswap:operatesOn>

  </sswap:Resource>

</rdf:RDF>

For a completed RDG see Object.

Hint: Use the HTTP API
You never need to write raw RDF/XML. Write your RDG (Resource Description Graph) in JSON (Javascript Object Notation) and use the HTTP API to automatically generate the RDF/XML document. See /make, Semantic Pipeline RESTful API /make, and /makeRDG.

MongoDB Logo MongoDB