[redland-dev] Abbreviating URIs in XML Attribute Values

David Phillips dphillips at janya.com
Fri Jun 17 15:47:31 CEST 2011


Hi Dave B.  Thanks for the response.

Perhaps if you get more requests for this feature, it will make its
way into redland?

Beyond the reduction in file size that this idiom achieves, there is a
striking increase in human-readability.  While human-readability might
not be a goal/virtue of rdfxml, in practice files in this format are
often returned as HTTP responses in some content negotiation regime.
People see them!  Maybe making them more readable would encourage
adoption of the underlying technology.  Who knows?

-Dave P.

On Fri, Jun 17, 2011 at 9:11 AM, Dave Beckett <dave at dajobe.org> wrote:
> On 6/17/11 1:24 AM, Nicholas J Humfrey wrote:
>> Hello Dave,
>>
>> I do not believe that using custom XML entities in RDF/XML is very common - or at least I havn't seen it for a long time.
>
> That's true, but it is more common in schema and ontology tools
>
>>
>> I am also unaware of anything in libraptor to allow you to do this.
>
> That's correct.  raptor would have to emit a DTD subset block before
> the <rdf:RDF> root element too.
>
> It's actually not too hard but would need a few new API calls to the
> serializer class and rdfxml serializer implementation and checks
> for emitting URIs in attribute values, which are done in a few places
> which would be straightforward to do .
>
>>
>> If it is of any help, Turtle is a lot more concise than RDF/XML.
>
> Although this is true, I think the better way to reduce data sizes of xml or
> general text formats is to use compression and then use streaming
> parsing via pipes: gunzip < bigfile.rdf.gz or popen().
>
> Dave
>
>>
>> nick.
>>
>>
>> On 16 Jun 2011, at 14:00, David Phillips <dphillips at janya.com> wrote:
>>
>>> Hello.
>>>
>>> I'm trying to get my RDF to be as little bloated as possible.  One way
>>> of doing this is by setting namespaces on the RDF serializer.  But the
>>> XML namespace spec only covers XML elements and XML attribute names.
>>> It does not cover XML attribute values.  That is, you can't use a
>>> qname in a context such as:
>>>
>>> <element attname="prefix:localname" />
>>>
>>> However, I've come across XML documents (in particular, OWL
>>> ontologies) which have the following:
>>>
>>> <element attname="&prefix;localname" />
>>>
>>> Instead of the prefix being defined with a namespace declaration it's
>>> defined with an entity declaration in the document's DOCTYPE.
>>>
>>> My question is: Is there any way of getting a librdf serializer to
>>> generate RDF with this sort of abbreviated attribute values?
>>>
>>> Thanks in advance!
>>>
>>> -Dave Phillips
>>> _______________________________________________
>>> redland-dev mailing list
>>> redland-dev at lists.librdf.org
>>> http://lists.librdf.org/mailman/listinfo/redland-dev
>> _______________________________________________
>> redland-dev mailing list
>> redland-dev at lists.librdf.org
>> http://lists.librdf.org/mailman/listinfo/redland-dev
>>
>
>


More information about the redland-dev mailing list