I'm novice in semaweb and trying to use surfrdf for handling data
(contacts, tasks etc) in my django (?) project (against RDBS).
Testing data - TimBL card (http://www.w3.org/People/Berners-Lee/
card#i), via rdflib (rdflib_example.py).
Questions are:
1. Can I list all defined (in this card) FOAF attributes - or I have
to try to get _each_ available in FOAF?
2. Can't get office address. person.contact_office.first returns BNode
- and that's all.
Hi Eugene,
On Tuesday, March 6, 2012 8:18:24 AM UTC+1, TI_Eugene wrote:I'm novice in semaweb and trying to use surfrdf for handling data
(contacts, tasks etc) in my django (?) project (against RDBS).
Testing data - TimBL card (http://www.w3.org/People/Berners-Lee/
card#i), via rdflib (rdflib_example.py).
Questions are:
1. Can I list all defined (in this card) FOAF attributes - or I have
to try to get _each_ available in FOAF?
yes you can, there are several ways to do that1) use the python dir function, end enumerate over all properties checking the ones that are in the foaf namespace
2) use the rdf_direct and rdf_inverse members where these properties are stored
3) export the graph() of the resource and find all FOAF properties
I think 2) is the way to go, but depends on your scenario
2. Can't get office address. person.contact_office.first returns BNode
- and that's all.
In Semantic Web, one can have nodes (objects or subjects) that do not have a public identifier (like a URL) those are called blank nodes (BNode in surf). A BNode has properties of it's own, so if you are looking to get the address, try to see what properties the BNode itself has.
Try to run attached script
2012/3/6 Cosmin Basca <cosmin...@gmail.com>: