S-Flux SourceForge.net Logo

Schemas

S-Flux implement a simple way to show and access functionalities of other applications. Applications expose their functionalities using RDF documents written following the rules and properties defined in a set of particular OWL/RDF vocabularies that covers properties about mime-types, application's features and operations.

Mimetypes

This schema is used to describe mimetpyes and their content-type. It's really simple and it definition can be found here.
The following is an exaplanation of the classes and their attributes:

ContentType class
No attributes
MimeType class
name String representing the name of the mimetype, for example 'text/plain' or 'image/jpeg'
hasContent URI of the content-type
canApply URI of an operation (see the operations section) that is suitable for the mimetype (this property is actually unused and isn't mandatory)

As an example consider that you want to define the 'text' content-type and the 'text/plain' mimetype. You'll have to write a document like the following:

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<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:mm="http://sflow.org/schema/2005-06/mimetype#"
  xml:base="http://sflow.org/data/2005-06/mimetype">

<mm:ContentType rdf:ID="text" />

<mm:MimeType rdf:ID="text_plain">
  <mm:name>text/plain</mm:name>
  <mm:hasContent rdf:resource="#text" />
</mm:MimeType>

</rdf:RDF>

Applications

Applications needs to expose their features that varies from their name to the version to what kind of mimetypes they can handle to what operations they can perform to particular mimetypes and how to perform them. The schema definition can be found here.
The following is an exaplanation of the classes and their attributes:

Application class
name String representing the name of the application
license String representing the type of license of the application (gpl, freeware, commercial...). This property is optional.
price Price of the application. This property is optional.
webURL Web address of the application. This property is optional.
version Version of the application. This property is optional.
hasGUI Boolean value, true if the application is a GUI application. This property is optional and false as default.
installationPath Path to where is placed the application executable main file
execCommand Name of the main executable application file
canRead URI to the mimetype that the application can read
canWrite URI to the mimetype that the application can modify
complexityLevel Application complexity level expressed as a number that can vary from 1 to 5. This property is optional.
canPerform Follow a RDF:Bag sequence of blank nodes having 'toMimeType' and 'operation' properties (see following properties)
operation URI to an operation that the application can perform (see the operations section)
toMimeType URI to the mimetype to which the application can perform the above operation
URLComment Web address to a page that deeply describe the operation. This property is optional.
parameters Follow a RDF:Seq sequence of blank-nodes describing the parameters needed by the operation. To describe them the next properties are used.
commandOption String used by the command line to identify the operation, for example '--convert'
parameterType URI identifying the type of the parameter (string, integer or boolean). This property is optional because not all parameters need a value. The URI has to be part of XML-Schema
parameterOrder Specify an order to the parameters. It's needed because actually librdf engine don't handle RDF:Seq sequences very well. This property is optional.
parameterLabel This property is optional and useful only when the parameter need a value. It's a string that will appear on S-Flux GUI indicating what the parameter is expecting. For example for an image rotation operation it will be "Rotation angle:"
parameterHelp A small help string about the parameter. This property is optional.

So let's see how an image editing program named 'imgedit' would define itself and its image concatenation functionality:

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<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:apps="http://sflow.org/schema/2005-06/applications#"
  xml:base="http://www.example.org/applications">

<apps:Application rdf:ID="imgedit">
  <apps:name>ImgEdit</apps:name>
  <apps:license>GPL</apps:license>
  <apps:price>0</apps:price>
  <apps:webURL>http://www.example.org/applications/imgedit</apps:webURL>
  <apps:installationPath>/usr/bin</apps:installationPath>
  <apps:execCommand>imgedit</apps:execCommand>
  <apps:version>1.1</apps:version>
  <apps:hasGUI>true</apps:hasGUI>
  <apps:complexity>1</apps:complexity>
  <apps:canWrite rdf:resource="http://sflow.org/data/2005-06/mimetype#image_jpeg" />
  <apps:canWrite rdf:resource="http://sflow.org/data/2005-06/mimetype#image_gif" />
  <apps:canPerform>
    <rdf:Bag>
      <rdf:li rdf:nodeID="_concatenation" />
    </rdf:Bag>
  </apps:canPerform>
</apps:Application>

<rdf:Description rdf:nodeID="_concatenation">
  <apps:toMimeType rdf:resource="http://sflow.org/data/2005-06/mimetype#image_jpeg" />
  <apps:toMimeType rdf:resource="http://sflow.org/data/2005-06/mimetype#image_gif" />
  <apps:operation rdf:resource="http://sflow.org/data/2005-06/operation#imageConcatenation" />
  <apps:parameters>
    <rdf:Seq>
      <rdf:li rdf:nodeID="_concatenation_p1" />
    </rdf:Seq>
  </apps:parameters>
</rdf:Description>

<rdf:Description rdf:nodeID="_concatenation_p1">
  <apps:commandOption>--append</apps:commandOption>
</rdf:Description>

Operations

This schema is used to define the classes that will describe the categories in which the operations can be organized and the single operations. The schema can be found here.
The following is an exaplanation of the classes and their attributes:

Category class
name String representing the name of the category
hasFather URI of the eventual father category. This property is optional.
Operation class
name String representing the name of the operation
returnMimeType If the operation produce a new document as result this property describe the URI of the resulting mimetype. This property is optional.
groupOperation Boolean value. It's true if the operation need one or more file in input and produce a single file in output. This property is optional.
shortComment Little help string. This property is optional.
hasCategory URI to the category of the operation. This property is optional.

As an example this is how you can describe the 'Search and replace' operation on a text document:

<ops:Category rdf:ID="TextEdit">
  <ops:name xml:lang="en">Edit</ops:name>
  <ops:name xml:lang="it">Modifica</ops:name>
</ops:Category>

<ops:Operation rdf:ID="textReplace">
  <ops:name xml:lang="en">Text replace</ops:name>
  <ops:name xml:lang="it">Sostitusci testo</ops:name>
  <ops:returnMimeType rdf:resource="http://sflow.org/data/2005-06/mimetype#text_plain" />
  <ops:hasCategory rdf:resource="#TextEdit" />
  <ops:shortComment xml:lang="en">Replace a string with another one</ops:shortComment>
  <ops:shortComment xml:lang="it">Sostituzione di una stringa con un'altra</ops:shortComment>
  <ops:URLComment>http://www.example.org/operations/replace.html</ops:URLComment>
</ops:Operation>