Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
how to control QName usage n3 and turtle serializers
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
László Török  
View profile  
 More options Nov 2 2011, 5:51 am
From: László Török <ltoro...@gmail.com>
Date: Wed, 2 Nov 2011 10:51:50 +0100
Local: Wed, Nov 2 2011 5:51 am
Subject: how to control QName usage n3 and turtle serializers

Hi,

I've started to use rdflib for a project @work. I've been trying to parse
rdf/xml and output n3 or turtle.

I'm using the in-memory graph store for manipulation.

One issue that has been giving me a hard time is that I don't seem be able
to control whether the URI's are serialized as full URIs or in qname format.

(http://example.org/#thing vs. ex:thing)

It seems this is handled by the getQName method in turtle.py.

The issue is caused by:

...
pfx = self.store.store.prefix(uri)
# in no case try to make a prefix if gen_prefix==False
if not gen_prefix and pfx is None:
            return None
...

and in memory.py:

def prefix(self, namespace):
        return self.__prefix.get(namespace, None)

which I believe is a simple string comparison.

Q: Is this intentional? Shouldn't prefix() be using the namespace manager
to perform the lookup?

Thanks

--
László Török

Skype: laczoka2000
Twitter: @laczoka


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »