Re: [PyWrapper-devel] Valid response model
Status: Alpha
Brought to you by:
jatorre
From: <m.d...@bg...> - 2006-12-14 10:49:41
|
Hi Roger, that's exactly what we were all thinking of doing for some time already. Good finally someone DOES it! The xml schema parser inside pywrapper is a custom implementation. I couldnt find any existing schema parser out there, honestly. So as you can imagine this is a pretty tough job and I have tried it with many different schemas and progressed in implementing xml schema, but still dont support all of it (for example references and patterns). Well, and your RDF schema is honestly the most complex I've seen that was fed to pywrapper. So I tried to trace the problem and as you see pywrapper complaints that the attribute http://rs.tdwg.org/ontology/voc/TaxonName#/ rdf:about is being referenced, but is nowhere defined. pywrapper expands all namespace prefixes into the full namespace. So in this case http://rs.tdwg.org/ontology/voc/TaxonName# is the targetnamespace of the imported lib/TaxonName.xsd schema file. So in there I suspect is a reference to rdf:about, which pywrapper thinks is an attribute name. I think this is because I cant find anywhere the prefix rdf: being defined properly. I suspect oXygen and alike know what rdf: means. So try to add a namespace declaration to the schemas (for owl etc too). Then pywrapper should expand rdf:about into the full qualified name http://www.w3.org/1999/02/22-rdf-syntax- ns#about and hopefully find the global declaration of rdf:about in the lib/rdf.xsd schema. But again, I think I've never tried a schema with that many namespaces and imports so I keep my fingers crossed... Please let me know what happens! Markus On Dec 13, 2006, at 11:29 PM, Roger Hyam wrote: > Hi All, > > I am looking at what TAPIR output models I could use with > PyWrapper. I have developed XML Schemas that will help produce > valid RDF instance data for a simple OWL ontology. Here is an example: > > http://rs.tdwg.org/ontology/voc/xsd/TaxonName/schema.xsd > > If you open this link in OxygenXML or Spy you can expand all the > nodes and create instance documents that look like valid RDF. Here > is an example instance document: > > http://rs.tdwg.org/ontology/voc/xsd/TaxonName/template.xml > > So the plan would be to use the schema above (or something similar) > as the structure in an output model so that a TAPIR response could > be a valid semantic web document and a LSID metadata response. A > complete LSID authority would need very little code on top of this. > > The downside is that these schemas are complex because of the > number of imports required to support the different namespaces > involved. > > Anyhow. The first step was to check that PyWrapper would parse > schemas like the one above so I did this: > > http://localhost:8080/pywrapper/pywrapper?op=schema&location=http:// > rs.tdwg.org/ontology/voc/xsd/TaxonName/schema.xsd > > on my local machine and got > > "The models response structure is invalid: Global element reference > 'http://rs.tdwg.org/ontology/voc/TaxonName#/rdf:about' missing" > > I am not sure why I get this as OxygenXML doesn't have a problem > with expanding the links and validating the rdf:about attribute so > I *think* the schema is OK. The parser is handling the import of > TaxonName.xsd OK. Is it a problem with attributes? Is it a bug or a > known limitation or an error in my schema? > > The are also problems with the group element but I can always work > round this by just repeating the element. > > Any ideas on the rdf:about problem would be most welcome. > > Many thanks, > > 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 |