W3C home > Mailing lists > Public > semantic-web@w3.org > April 2010

Re: Processing RDF in XML/XSLT workflows

From: Giovanni Tummarello <g.tummarello@gmail.com>
Date: Tue, 27 Apr 2010 23:30:52 +0200
Message-ID: <u2o210271541004271430o71f17ec0p9aede19a191ec9cf@mail.gmail.com>
To: Johan De Smedt <johan.de-smedt@tenforce.com>
Cc: semantic-web <semantic-web@w3.org>
might be of interest  for http://pipes.deri.org

there has been quite a bit of work on it.. the GUI produces an XML
file which you  can then execute with the standalone Jar.

cheers
Gio

On Mon, Apr 26, 2010 at 12:11 AM, Johan De Smedt
<johan.de-smedt@tenforce.com> wrote:
> Hi,
>
> When publishing content, XSLT is a key technology.
> RDF however is kind of difficult to process with XSLT.
> Though there is an RDF/XML serialization, that standard allows for a variety
> of ways to express the same things.
>
> The notes below propose a restricted version of RDF/XML and some usage
> conventions.
> The objective is to make RDF easily processable by XSLT.
>
> I am interested in any alternative.
> SPARQL result xml is not a full solution because it is limited to ASK and
> SELECT queries.
> Hence the attached proposal.
>
> Just like canonical XML, I think this restricted RDF/XML format may be of
> interest as a reference in XML processing.
> Please let me know if others are interested to discuss this.
>
> Notes:
> Graph representation proposal (restricted RDF/XML usage)
> - the result is a list of resources which have properties.
> - the id of a resource is an IRI or a CURIE
> - all blank nodes are nested within properties.
>
> <rdf:RDF {namespace}* > -- the namespaces are the ones used in
> CURIES/element names
>   <rdf:Description rdf:about="{subject-uri}">
>     <rdf:type rdf:resource="{class-uri}"/> *
>     (  -- plain literal with optional language
>     <{data-property-curie} [ xml:lang="{lang-code}" ]> {...value...}
> </{data-property-curie}>
>    or -- xml literal
>     <{data-property-curie} rdf:parseType="rdf:XMLLiteral" {namespace}* > --
> the namespaces are the ones used in xml-content
>        {...xml-content.}
>     </{data-property-curie}>*
>     or -- typed literal
>     <{data-property-curie} rdf:datatype="{simple-XML-schema-data-type}">
>        {...value...}
>     </{data-property-curie}>*
>    or  -- expanded blank node
>     <{object-property-curie}  rdf:parseType="Resource">
>         <rdf:Description>
>         .
>         </rdf:Description>
>     </{object-property-curie}>
>    or -- any resource with a known URI
>     <{object-property-curie} rdf:resource="{uri}"/>
>     )*
>   </rdf:Description>*
> </rdf:RDF>
>
> Writing xslt extensions to process RDF on a node by node navigation basis:
>  - connect to an RDF store and identify a graph
>  - navigate through the graph by iterating all (or selected) properties of
> one or more selected subject resources.
>  - represent each triple of the iteration result so it is easily processed
> by XSLT (with a unique representation).
>  - allow this property iteration to be nested such that object resource can
> be visited recursively.
> Proposal for result representation (see above)
>
> 1) connecting to an RDF store + graph(s) for access
>
> 2) To get statements from this store and to merge the RDF into XML,
> something like
> <xsl:variable name="rdfresult"
> select="readrdf:for-each-property($subjects,$namespaces,$filter)"/>
> Where:
>        namespaces="{alias uri}*"       -- namespaces used in subjects and
> filter
>        subjects="{subject-uri}+"
>        filter="{property-curie}*"      -- empty filter or no filter => give
> all properties
>
> 3) Process the result based on xml nodes (see next page) as follows
> 3.1) typical processing :
> <xsl:for-each
> select="$rdfresult/rdf:RDF/rdf:Description[@rdf:about='{subject-uri}']/*..."
>>
>        <xsl:variable name="current-property" select="name()"/>
>        . do other stuff
> </xsl:for-each>
> 3.2) recursive processing :
> <xsl:for-each
> select="$rdfresult/rdf:RDF/rdf:Description[@rdf:about='{subject-uri}']/*[@rd
> f:resource]">
>        <xsl:variable name="current-property" select="name()"/>
>        <xsl:variable name="current-uri" select="@rdf:resource"/>
>                . recursively process as from step 2 using $current-uri as
> he (new) subject-uri ...
> </xsl:for-each>
>
> Kind Regards,
>   Johan De Smedt (CTO TenForce)
> =======================
> mail: johan.de-smedt@tenforce.com
> mobile: +32 477 475934
>
>
>
>
>
Received on Tuesday, 27 April 2010 21:31:26 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 08:45:17 UTC