Re: [PyWrapper-devel] Behold RDF is born unto us!
Status: Alpha
Brought to you by:
jatorre
From: <m.d...@bg...> - 2007-01-05 16:21:19
|
well done Roger! worked out of the box for me. I guess you are right that pywrapper ignores attribute namespaces in the output. I will take a look into it. Not sure how well the frameworks support attribute namespaces, cause I am not aware of how to declare namespace prefixes implicitly. The code at least knows the namespace of the attribute, so its only a matter of how to get it out. Currently I am using DOM to produce the XML but I wanted to migrate to Elementree at some point. I will keep you informed. Creating an alias.txt for the TDWG ontology would be the exact way we thought of how to use it. So far pywrapper seemed to work fine with multiple CNS files. Simply add a second one in the system configtool pane. Just make sure they dont clash - that is defining the same namespace or using the same namespace alias. The aliases for the concepts don't matter, cause they only form one part of the total concept alias. So we only need to keep track of the namespaces and their aliases. cheers, markus On Jan 4, 2007, at 5:30 PM, Roger Hyam wrote: > Happy New Year everyone. > > If you have a local pywrapper and have connected the training > datasource up to a database then you should be able to run this > query (long URL) perhaps with minor tweaks to the port etc. > > http://localhost:8080/pywrapper/pywrapper? > dsa=training&op=search&envelope=false&model=http://rs.tdwg.org/ > ontology/voc/tapir/outputmodel/ > TaxonName_001.xml&filter=UnitID@abcd206+like+"2422" > > What you will get back is (but for one minor minor thing) valid RDF! > > After Markus' fix (and after Christmas) I turned to making a real- > life output model and it is actually quite simple once you have the > framework in place. > > This is still a fairly trivial example but it shows that it is > possible and I'll continue to build on it up to the workshop. > > **WARNING** I am using the identifications table in the training > dsa as if it contained pure nomenclatural data just because I have > the TaxonName vocabulary to hand. This is not how the vocabulary > should or will be used. It is just a test thing. I'll now try and > do some more sensible things. > > The fun part is that I use the mapped ABCD concepts in my output > model. So we are creating RDF from a datasource that was never > intended to supply it :) Not sure how possible this will be in real > life for retrofitting data suppliers who haven't done the mappings > to the central concepts but is a possibility. > > I have one question about Concept Name Servers. It would make sense > to have a CNS for the TDWG ontology. We could then define the RDF > generating models and some query templates in it along with their > associated concepts. We would need some convention to prevent name > clashes with the alias'. > > Can anyone see a problem with this? Will PyWrapper pick up multiple > CNS and load them all? Has this been tested? > > The mapping is fun here because the TAPIR concepts map to db > concepts through the regular mechanisms but are also mapped, via > the namespace conventions in the RDF to more general meanings. > > I also have a request. If you take the result of running the above > (it looks like this) > > <?xml version="1.0" encoding="UTF-8"?> > > > <RDF xmlns='http://www.w3.org/1999/02/22-rdf-syntax-ns#'> > <TaxonName xmlns='http://rs.tdwg.org/ontology/voc/TaxonName#' > about='2422'> > <title xmlns='http://purl.org/dc/elements/1.1/'>Calicium > adspersum Pers. subsp. australe Tibell</title> > <genusPart>Calicium</genusPart> > <specificEpithet>adspersum</specificEpithet> > <infraspecificEpithet>australe</infraspecificEpithet> > </TaxonName> > </RDF> > > and cut and paste it into the W3C RDF validator (http://www.w3.org/ > RDF/Validator/) you get a single deprecated warning. > > Error: {W102} unqualified use of rdf:about is deprecated.[Line = 5, > Column = 78] > > It seems that PyWrapper isn't putting the namespace in for the > attribute in the output. I have not looked into it in detail but it > is specified in the model and other namespace stuff is followed so > I guess it is a bug (this is the minor minor thing that will come > to bite us when we need rdf:resource references going). > > Could someone with their hands on the code (sorry is that you > Markus!) look at this one. Then I think we will be really RDF > compatible. > > Many thanks, > > All the best, > > Roger > > > **************************************** > Roger Hyam <ro...@td...> > Biodiversity Information Standards > **************************************** > > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV________________________________ > _______________ > PyWrapper-devel mailing list > PyW...@li... > https://lists.sourceforge.net/lists/listinfo/pywrapper-devel |