instanciating a Resource() directly

5 views
Skip to first unread message

Dominique Guardiola Falco

unread,
Jun 8, 2011, 5:06:26 AM6/8/11
to sur...@googlegroups.com
I'll answer on the list as that's Christoph suggested

Le 7 juin 11 à 22:20, cburgmer a écrit :

> First, you are loading an onthology into SuRF for which it was not
> designed.

in fact, I can parse any owl ontology, because they all have in
general a Owl:Ontology class
the problem appeared only with older rdf vocabularies (dcterms and geo
actually), which are directly described without being typed.

> For example 'http://www.w3.org/2003/01/geo/wgs84_pos#' has no Class
> information, the basic foundation of SuRF's class mapping.

that's it :)

> What you want to do here:
>>>> test = surf.resource.Resource(subject=rdflib.URIRef('http://www.w3.org/2003/01/geo/wgs84_pos#'))
> is normally done via
>>>> test = session.get_resource(rdflib.URIRef('http://www.w3.org/2003/01/geo/wgs84_pos#'))

great, it's simpler like that, and does not raise the exception I was
reporting in github


> You call session.get_resource() without passing it a Class. While it
> seems SuRF was designed to handle this (the code has been written
> before I used SuRF) it is currently broken. I'm creating a bug
> report at the project page, check there if you want to know about
> any possible solution.

looks like it's complaining about the lack of a store attached to the
resourcemeta class passed, but i don't get it at his point...

maybe for now I should try to grab this non-typed resource with rdflib
directly


--
Dominique Guardiola, QUINODE
http://www.quinode.fr/
• Tel : 04.27.86.84.37
• Mob : 06.15.13.22.27

Christoph Burgmer

unread,
Jun 8, 2011, 5:45:46 AM6/8/11
to sur...@googlegroups.com
> Le 7 juin 11 à 22:20, cburgmer a écrit :
> > First, you are loading an onthology into SuRF for which it was not
> > designed.
>
> in fact, I can parse any owl ontology, because they all have in
> general a Owl:Ontology class
> the problem appeared only with older rdf vocabularies (dcterms and geo
> actually), which are directly described without being typed.

Ok, I can agree on that :)

> > You call session.get_resource() without passing it a Class. While it
> > seems SuRF was designed to handle this (the code has been written
> > before I used SuRF) it is currently broken. I'm creating a bug
> > report at the project page, check there if you want to know about
> > any possible solution.
>
> looks like it's complaining about the lack of a store attached to the
> resourcemeta class passed, but i don't get it at his point...

I've linked to the commit in
http://code.google.com/p/surfrdf/issues/detail?id=74 that I believe broke the
functionality. I guess SuRF was initially conceived as a single session
application and later on chaned to support several sessions. Hover some code
didn't get changed. Honestly I only learnt what concept() was supposed to do,
yesterday.

As suggested a fix could include moving the concept() method away from the
Resource. The goal in either way is to make get_resource() work without a
class supplied optionally.

> maybe for now I should try to grab this non-typed resource with rdflib
> directly

I think you brought up an interesting point. Would there be a use case in SuRF
for untyped objects? However, implementing something along this way would
break with a fundamental design choice as we ask for rdf:type everywhere.

-Christoph

Reply all
Reply to author
Forward
0 new messages