OpenService Extensions: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
Line 7: Line 7:
==mime-type==
==mime-type==


application/opensearchdescription+xml
OpenService description documents are referred to via the following type:


==HTML Discovery==
application/openservicedescription+xml


= OpenService extension for microformats contexts =
This type is pending IANA registration.


==Automatic Discovery==


HTML and XHTML documents may reference related OpenService description documents via the HTML 4.0 <link/> element.
The following restrictions apply:
* The "type" attribute must contain the value "application/openservicedescription+xml ".
* The "rel" attribute must contain the value "service".
* The "href" attribute must contain a URI that resolves to an OpenService description document.
* The "title" attribute may contain a human-readable plain text string describing the service.
The HTML <head/> element should include a "profile" attribute that contains the value "http://www.microsoft.com/schemas/openservicedescription/1.0".
Example of an HTML document that includes OpenSearch autodiscovery link elements:
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
  <head profile="http://www.microsoft.com/schemas/openservicedescription/1.0">
    <!--- ... --->
    <link rel="service"
          type="application/openservicedescription+xml"
          href="http://example.com/service1.xml"
          title="Service 1" />
    <link rel="service"
          type="application/opensearchdescription+xml"
          href="http://example.com/service2.xml"
          title="Service 2" />
    <!--- ... --->
  </head>
  <body>
    <!--- ... --->
  </body>
</html>
<pre>
The "rel" attribute of the link element should contain the value "service" when referring to OpenService description documents. This relationship value is pending IANA registration.
= OpenService extension for microformats contexts (a.k.a. microservices) =
OpenService description includes the context concept which is used to describe the content this service can be applied to.  The possible contexts included in the original OpenService specification are    This specification extends that values to include microformats as posible '''contexts'''.
The other extension required is the '''variables''' that can be used to compose the url parameters that will be sent to the service.  These new variables include the values of the microservices.
<pre>
<?xml version="1.0" encoding="utf-8"?>
<openServiceDescription
xmlns="http://www.microsoft.com/schemas/openservicedescription/1.0">
<display>
<name>Find videos on YouTube</name>
<icon>http://www.youtube.com/favicon.ico</icon>
</display>
<homepageUrl>http://youtube.com</homepageUrl>
<activity category="Tags">
<activityAction context="tag">
<execute method="get"
action="http://youtube.com/results?search_query={tag.tag}">
</execute>
</activityAction>
</activity>
</openServiceDescription>
</pre>
Pending issues:
* Include support for services that require more than one microformat.
* Include support for semantic content other than microformats (RDF, RDFa, eRDF)
= OpenService extension to describe Operator User Scripts =
= OpenService extension to describe Operator User Scripts =
<pre>
<?xml version="1.0" encoding="utf-8"?>
<openServiceDescription xmlns="http://www.microsoft.com/schemas/openservicedescription/1.0">
<display>
<name>Find videos on YouTube</name>
<icon>http://www.youtube.com/favicon.ico</icon>
</display>
<homepageUrl>http://youtube.com</homepageUrl>
<activity category="Tags">
<activityAction context="tag">
<execute method="script">
<script>
<![CDATA[
if (semanticObject.tag) {
return("http://youtube.com/results?search_query=" + encodeURIComponent(semanticObject.tag));
}
]]>
</script>
</execute>
</activityAction>
</activity>
</openServiceDescription>
</pre>

Revision as of 21:53, 28 April 2008

To increase the value of web content annotated with microformats (or other semantic web technologies) it is required to define a language that can be used by web applications to describe and publish their services available for different semantic contents (e.g. for a hCard).

There could be other alternatives, but one of them is to extend Microsoft [Service Description] and reusing also some [Search] concepts.

Generic OpenService Extension

mime-type

OpenService description documents are referred to via the following type:

application/openservicedescription+xml

This type is pending IANA registration.

Automatic Discovery

HTML and XHTML documents may reference related OpenService description documents via the HTML 4.0 <link/> element.

The following restrictions apply:

  • The "type" attribute must contain the value "application/openservicedescription+xml ".
  • The "rel" attribute must contain the value "service".
  • The "href" attribute must contain a URI that resolves to an OpenService description document.
  • The "title" attribute may contain a human-readable plain text string describing the service.

The HTML <head/> element should include a "profile" attribute that contains the value "http://www.microsoft.com/schemas/openservicedescription/1.0". Example of an HTML document that includes OpenSearch autodiscovery link elements:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
   <head profile="http://www.microsoft.com/schemas/openservicedescription/1.0">
     <!--- ... --->
     <link rel="service"
           type="application/openservicedescription+xml" 
           href="http://example.com/service1.xml"
           title="Service 1" />
     <link rel="service"
           type="application/opensearchdescription+xml" 
           href="http://example.com/service2.xml"
           title="Service 2" />
     <!--- ... --->
   </head>
   <body>
     <!--- ... --->
   </body>
 </html>
<pre>

The "rel" attribute of the link element should contain the value "service" when referring to OpenService description documents. This relationship value is pending IANA registration. 

= OpenService extension for microformats contexts (a.k.a. microservices) =

OpenService description includes the context concept which is used to describe the content this service can be applied to.  The possible contexts included in the original OpenService specification are    This specification extends that values to include microformats as posible '''contexts'''.

The other extension required is the '''variables''' that can be used to compose the url parameters that will be sent to the service.  These new variables include the values of the microservices.

<pre>
<?xml version="1.0" encoding="utf-8"?>
<openServiceDescription
xmlns="http://www.microsoft.com/schemas/openservicedescription/1.0">
<display>
<name>Find videos on YouTube</name>
<icon>http://www.youtube.com/favicon.ico</icon>
</display>
<homepageUrl>http://youtube.com</homepageUrl>
<activity category="Tags">
<activityAction context="tag">
<execute method="get"
action="http://youtube.com/results?search_query={tag.tag}">
</execute>
</activityAction>
</activity>
</openServiceDescription>

Pending issues:

  • Include support for services that require more than one microformat.
  • Include support for semantic content other than microformats (RDF, RDFa, eRDF)

OpenService extension to describe Operator User Scripts

<?xml version="1.0" encoding="utf-8"?>
<openServiceDescription xmlns="http://www.microsoft.com/schemas/openservicedescription/1.0">
<display>
<name>Find videos on YouTube</name>
<icon>http://www.youtube.com/favicon.ico</icon>
</display>

<homepageUrl>http://youtube.com</homepageUrl>
<activity category="Tags">
<activityAction context="tag">
<execute method="script">
<script>
<![CDATA[
if (semanticObject.tag) {
return("http://youtube.com/results?search_query=" + encodeURIComponent(semanticObject.tag));
}
]]>
</script>
</execute>
</activityAction>
</activity>

</openServiceDescription>