Menu

Protocol-Object

Damian Gessler
Attachments
SSWAProtocol-Object.png (71496 bytes)

Object


Provider      Resource      Graph      Subject      Object

Object

In the concept of a service mapping an input to an output, the Object corresponds to the output. The property sswap:mapsTo demarcates the mapping (or transformation) of the input (Subject) to the output (Object). An Object 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 Object 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 Optional property that connects an Object to a Subject in an inverse mapping. Because the rdfs:domain of sswap:mapsTo is a Subject and its rdfs:range is an Object, an Object with this property will be inferred to be also a Subject, and the Subject it points to will be infered to be an Object. This usage is discouraged.

Examples: Building an RDG (Resource Description Graph)

1. A complete RDG that shows the mapping of an input Subject of MIME type "any image" (the class "mime:image/\_" from the MIME ontology) to an output Object of type mime:image/Png. This semantically tags both input and the output. Types may be simple or complex, named or anonymous, and mix-n-matched across ontologies; the subjects and objects themselves may have user-defined data and object properties. For more ontologies, see SSWAPMeet

<?xml version="1.0"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:sswap="http://sswapmeet.sswap.info/sswap/"
    xmlns:mime="http://sswapmeet.sswap.info/mime/"
    >

    <sswap:Resource rdf:about="http://sswap.info/sswap-pipeline-test/test/data/pipeline/convertToPNG">

  <sswap:name>Converter to PNG</sswap:name>

  <sswap:oneLineDescription>Given an image in a format supported by Java ImageIO, it converts it into PNG</sswap:oneLineDescription>

  <sswap:icon rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">http://sswap.info/sswap-pipeline-test/convertToPNG.png</sswap:icon>

      <sswap:operatesOn>
       <sswap:Graph>
        <sswap:hasMapping>

          <sswap:Subject>

            <rdf:type>
              <owl:Class rdf:about="http://sswapmeet.sswap.info/mime/image/_"/>
            </rdf:type>

            <sswap:mapsTo>
              <sswap:Object>

                <rdf:type>
                  <owl:Class rdf:about="http://sswapmeet.sswap.info/mime/Png"/>
                </rdf:type>

              </sswap:Object>
            </sswap:mapsTo>

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

    <sswap:providedBy>
      &t;sswap:Provider rdf:about="http://sswap.info/sswap-pipeline-test/resourceProvider"/>
    </sswap:providedBy>

  </sswap:Resource>

  <owl:Class rdf:about="http://sswapmeet.sswap.info/sswap/Resource"/>
  <owl:Class rdf:about="http://sswapmeet.sswap.info/sswap/Subject"/>
  <owl:Class rdf:about="http://sswapmeet.sswap.info/sswap/Provider"/>
  <owl:Class rdf:about="http://sswapmeet.sswap.info/sswap/Graph"/>
  <owl:Class rdf:about="http://sswapmeet.sswap.info/mime/image/Png"/>

</rdf:RDF>

2. Examples of RDGs are easy in SSWAP: visiting the URL of the sswap:Resource of the RDG always returns the RDG. To find services and see RDGs, visit sswap.info.

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.

JSON encoding for an RDG. Use the HTTP API to convert it to RDF/XML prior to hosting.

{
  "api" : "/makeRDG",

  "prefix" : {
    "mime"        : "http://sswapmeet.sswap.info/mime/",
    "myHome"      : "http://sswap.info/sswap-pipeline-test/",
  },

  "myHome:convertToPNG" : {

    "sswap:name" : "Converter to PNG",
    "sswap:oneLineDescription" : "Given an image in a format supported by Java ImageIO, it converts it into PNG",
    "sswap:icon" : "http://sswap.info/sswap-pipeline-test/convertToPNG.png",
    "sswap:providedBy" : "myHome:resourceProvider",

  },

  "mapping" : { "mime:image/_" : "mime:Png" }

}

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.