Automatic Code Generation

5 views
Skip to first unread message

Phil

unread,
May 15, 2008, 11:46:30 AM5/15/08
to rdfalchemy-dev
I haven't posted an update to cheeseshop in a while but there is a
addition to the dev code-base that I thought I should share sooner
rather than later.

Just hacked together last night:

the os command line there is a paster command (rdfSubject) to generate
your RDFAlchemy model file from a schema.

If you have a schema file and hate typing and tpyos... check out:

http://www.openvest.com/trac/wiki/RDFAlchemyPaster

<input_solicitation>
Time saver ... but very preliminary code

There is also the beginings of an os command
line script for querying a sparql endpoint.
Not sure what a good usage/interface model is yet
</input_solicitation>

Should help new-comers get up and running quickly.

--
Phil



Bruce D'Arcus

unread,
May 15, 2008, 6:44:02 PM5/15/08
to rdfalchemy-dev


On May 15, 11:46 am, Phil <philip.coo...@openvest.com> wrote:

> Just hacked together last night:
>
> the os command line there is a paster command (rdfSubject) to generate
> your RDFAlchemy model file from a schema.
>
> If you have a schema file and hate typing and tpyos... check out:

Cool!

I presume ATM it only sees rdfs:Class; might be nice to add owl:Class?

Bruce

Philip Cooper

unread,
May 15, 2008, 7:13:31 PM5/15/08
to rdfalch...@googlegroups.com
Bruce D'Arcus at about 5/15/08 4:44 PM said:
> I presume ATM it only sees rdfs:Class; might be nice to add owl:Class?
>

Got it covered checkout rev133. Presents some issues because of
"defined" classes so it will take more care.

I'd like to get some of the "new" descriptors fired up.

I think an "inverseOf" property on descriptors would be cool for
biblio. You could get a list of author publications with

>> pubList = author.creatorOf

given nothing but the "classic" dc:creator triples.

where creatorOf is like:

>> {?pub dc:creator ?author} => {?author ?:creatorOf ?pub}.

--
Phil

philip_cooper.vcf

Bruce D'Arcus

unread,
May 16, 2008, 8:50:48 AM5/16/08
to rdfalchemy-dev


On May 15, 7:13 pm, Philip Cooper <philip.coo...@openvest.com> wrote:
> Bruce D'Arcus at about 5/15/08 4:44 PM said:
>
> > I presume ATM it only sees rdfs:Class; might be nice to add owl:Class?
>
> Got it covered checkout rev133.  Presents some issues because of
> "defined" classes so it will take more care.

Hmm ... any hints on what this error might be caused by? I'd not seen
it before updating to this rev.

paster rdfSubject -s samples/schema/foaf.rdf
An unknown error occurred. could not get plugin for rdf, <class
'rdflib.syntax.parsers.Parser'>: <class
'rdflib.syntax.parsers.Parser'>

> I'd like to get some of the "new" descriptors fired up.
>
> I think an "inverseOf" property on descriptors would be cool for
> biblio. You could get a list of author publications with
>
>  >> pubList = author.creatorOf
>
> given nothing but the "classic" dc:creator triples.

Yes, that *would* be nice. If you're looking for test cases, I've got
a (to be formally published soon) draft of the biblio ontology at:

<http://www.users.muohio.edu/darcusb/rdf/schemas/bibo.n3>

Bruce

Philip Cooper

unread,
May 16, 2008, 9:33:09 AM5/16/08
to rdfalch...@googlegroups.com
Bruce D'Arcus at about 5/16/08 6:50 AM said:
>
>
> On May 15, 7:13 pm, Philip Cooper <philip.coo...@openvest.com> wrote:
>> Bruce D'Arcus at about 5/15/08 4:44 PM said:
> Hmm ... any hints on what this error might be caused by? ...

Sorry broke something while trying to add a feature :-(

Fixed in new rev. BTW the upgrade was to allow n3 schemas which I see
you use. :-)

> a (to be formally published soon) draft of the biblio ontology at:
>
> <http://www.users.muohio.edu/darcusb/rdf/schemas/bibo.n3>
>


Thanks I ran a couple of classes through and it is working. To
get it to work I needed the "subclassing" ver of ClassInstances.

... makes me wonder if filter_by and or get_by should respect subclass
definitions?? I'll have to ponder that for a while. With the size
of your schema, you probably want the "(a)ll" feature of the code
generation so I'll look into that too.

--
Phil

Bruce D'Arcus

unread,
May 17, 2008, 11:54:22 AM5/17/08
to rdfalchemy-dev
If I do that, I get an error:

Enter (a)ll,(q)uit or the number ot build for ['q']: a
An unknown error occurred. 'NotImplementedType' object is not callable

Bruce
Reply all
Reply to author
Forward
0 new messages