Thanks for sharing, Nick! I am using pydantic now to model requests/responses for my FastAPI app, for which modeing with pydantic is helpful for generating an OpenAPI spec. I am planning to use an RDF-based store (TerminusDB) for metadata storage, but I haven't started implementing that yet. The approach of having RDF conversion directly attached to pydantic models, e.g. via a `to_graph()` method as you demonstrate, could be very nice for me as well. I will follow up if I end up using such an approach.
On Tuesday, May 25, 2021 at 10:10:41 AM UTC-4 [email protected] wrote: > Hi Nicolas, > > Thank you for this! This will be extremely handy to distribute thesauri > work to my not so RDF savvy colleagues. > I like the work of SHACL play, but it's hard to contribute to the Java > codebases. Python is much quicker. > In that respect, some time back I also ported (parts of) their shacl to > plant uml generator (https://github.com/viaacode/shacl2plantuml), which I > plan to extend towards a SHACL+RDFS datamodel markdown documentation tool > that can be used in combination with static compile sites. > > Unfortunately no experience with pydantic. > > Best, > > Miel > > Op di 25 mei 2021 om 15:56 schreef Nicholas Car < > [email protected]>: > >> Dear RDFlib devs, >> >> I've just created a small tool to convert SKOS vocabularies presented in >> Excel to RDF: https://github.com/surroundaustralia/VocExcel >> >> This is hardly a new concept (PoolParty, SKOSPlay! and others have >> Excel-to-SKOS tools) but we need vocabs of a particular style. >> >> For this list's interest: I'm using RDFlib 6.0.0a0 along with pydantic >> Model classes which define Python classes mirroring major SKOS objects >> (ConceptScheme, Concept & Collection) and then convert those class >> instances to RDF, see >> https://github.com/surroundaustralia/VocExcel/blob/master/vocexcel/models.py >> . >> >> Does anyone else pydantic with rdflib and, if so, what equivalent to my >> to_graph() >> methods do you use? >> >> Cheers, >> >> Nick >> >> -- >> >> >> ______________________________________________________________________________________ >> kind regards >> *Dr Nicholas Car* >> Data Systems Architect >> SURROUND Australia Pty Ltd and >> SURROUND NZ Limited >> Address Level 9, Nishi Building, >> 2 Phillip Law Street >> New Acton Canberra 2601 >> Mobile +61 477 560 177 <++61+477+560+177> >> Email [email protected] >> https://www.surroundaustralia.com >> >> *Enhancing Intelligence Within Organisations* >> *delivering evidence that connects decisions to outcomes* >> >> >> [image: Australian-National-University-Logo-1 – ANU Centre for Water and >> Landscape Dynamics] >> >> *Dr Nicholas Car* >> Adj. Senior Lecturer >> >> Research School of Computer Science >> >> The Australian National University >> Canberra ACT Australia >> >> >> >> https://orcid.org/0000-0002-8742-7730 >> >> https://cs.anu.edu.au/people/nicholas-car >> >> *Copyrights:* >> SURROUND Australia Pty Ltd is the copyright owner of all original >> content and attachments. >> >> All rights reserved. >> >> *Confidentiality Notice:* >> The contents of this email are confidential to the ordinary user of the >> email address to which >> it is addressed, and may also be privileged. If you are not the >> addressee of this email, you >> may not copy, forward, disclose, or otherwise use it or any part of it or >> its attachments in any >> form whatsoever. If you have received this email in error, please email >> the sender by replying >> to this message. >> >> -- >> http://github.com/RDFLib >> --- >> You received this message because you are subscribed to the Google Groups >> "rdflib-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/rdflib-dev/CAP7nqh1donE5o_Fedup4EbKtfUBJSmGmahUi5O8vq_md9jftJA%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/rdflib-dev/CAP7nqh1donE5o_Fedup4EbKtfUBJSmGmahUi5O8vq_md9jftJA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- http://github.com/RDFLib --- You received this message because you are subscribed to the Google Groups "rdflib-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/075c1222-c11d-4de6-93d5-5bdf0b343e01n%40googlegroups.com.
