Andre Meyer wrote:
Dear Michel
Maybe you remember Spyse (http://spyse.sf.net/) ;-)
Sure do Andre! We have a new mailing list now ([email protected]) which I
am cc:ing with your email. Please subscribe to the list and join us
with your questions and discussion, many more folks can help you there.
Here's the list URL http://rdflib.net/mailman/listinfo/dev
At the moment, I am finally adding RDF support to Spyse using rdflib.
There are two things:
- Use RDF to encode message content: create a subgraph, serialise it,
send it to another agent, parse it. I have some problems with this
described in a mial to Daniel (see below).
Ok, I added some comments below.
- Use RDF as an environment model store: all context information is
stored in an rdflib Graph and entities can be retrieved using SPARQL
queries. This seems to work well and I should have a first version
running soon. What I do not understand, yet, is how I can use RDFS to
describe an ontology for the environment and enforce it in the graph.
You can certainly use RDFS in rdflib, just write RDFS statements in
whatever flavor of syntax you want (xml, n3, etc.). Enforcement is
something rdflib doesn't do, yet. That's something we can put on the
roadmap however. For now you have to roll your own enforcement.
How can I use RDFS ontologies in order to make sure that triples that
are added to the graph are verified according to that ontology. I
looked at the source, but cannot find a clue.
As I mentioned, unfortunately at thsi point you must enforce your own
policy.
Is it possible to use RDF reasoners with rdflib?
Sure! Although most reasoners would need you to serialize the rdflib
data to some syntax (like xml) and then reason on it, and then
de-serialize it back into a graph. For very large graphs this is
probably inefficient, but a reasoner that interfaced directly with the
Graph API would be very cool.
Here are some observations:
- The 'pretty-xml' serializer omits the subject. It does not appear in
the about parameter of the Description tag.
Ouch. Anyone want to tackle that one? ;)
- The xml parser interprets the about parameter when it is manually
inserted in an rdf file. For example:
<rdf:Description about=" http://python.openspace.nl/foaf#donna
<http://python.openspace.nl/foaf#donna>">
- The n3 serializer uses the subject as one would expect.
- The n3 parser does not work. I get the following error messages when
trying to parse the n3 output that was just serialized:
Traceback (most recent call last):
File "D:\projects\experiments
\rdflib_experiment.py", line 99, in ?
receiver_store.parse(receiver_source)
File "C:\Python24\lib\site-packages\rdflib\Graph.py", line 565, in
parse
context.parse(source, publicID=publicID, format=format, **args)
File "C:\Python24\lib\site-packages\rdflib\Graph.py", line 438, in
parse
parser.parse(source, self, **args)
File
"C:\Python24\Lib\site-packages\rdflib\syntax\parsers\RDFXMLParser.py",
line 37, in parse
self._parser.parse(source)
File "C:\Python24\lib\xml\sax\expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "C:\Python24\lib\xml\sax\xmlreader.py", line 123, in parse
self.feed(buffer)
File "C:\Python24\lib\xml\sax\expatreader.py", line 211, in feed
self._err_handler.fatalError(exc)
File "C:\Python24\lib\xml\sax\handler.py", line 38, in fatalError
raise exception
xml.sax._exceptions.SAXParseException: <unknown>:1:7: not well-formed
(invalid token)
This looks like you are trying to use the XML parser, not the n3 parser,
perhaps that's why it apears broken.
Hope this helps, how's spyse coming along?
-Michel
--
Dr. Andre P. Meyer
http://python.openspace.nl/meyer
TNO Defence, Security and Safety http://www.tno.nl/
Delft Cooperation on Intelligent Systems http://www.decis.nl/
Ah, this is obviously some strange usage of the word 'safe' that I
wasn't previously aware of. - Douglas Adams
--
Dr. Andre P. Meyer http://python.openspace.nl/meyer
TNO Defence, Security and Safety http://www.tno.nl/
Delft Cooperation on Intelligent Systems http://www.decis.nl/
Ah, this is obviously some strange usage of the word 'safe' that I
wasn't previously aware of. - Douglas Adams
_______________________________________________
Dev mailing list
[email protected]
http://rdflib.net/mailman/listinfo/dev