Adding new terms to PyLode
lagbolt opened this issue · 7 comments
I verified that rdflib preserves comments, descriptions, etc., so the graph of parsed input does contain the right thing.
Here's what I've found messing around in the pylode repo ...
This code in pylode:
adds a DCTERMS.description triple to the graph for any DC.description, RDFS.comment, SKOS.definition or SDO.description, presumably so that they can all be treated exactly the same downstream. Nothing is deleted from the graph, just added. There's similar code in vocpub.py and utils.py. These are the only places that DC.description, etc. is mentioned in the repo.
DCTERMS.description appears to be used only once:
https://github.com/RDFLib/pyLODE/blob/a2485cbb9bbdee58368b19d0ebb5c5ac38b7271b/pylode/utils.py#L223
in a function get_prop_label, which is called by back_onts_label_props, which is called by OntPub.__init__ to set self.props_labeled, which is used in _make_metadata (really, making html):
which calls append_child in the dominate library, which I guess actually makes the html.
-- Graeme
I wouldn't mind, for starters, if the order of the skos:definition and the rdfs:comment were reversed (definition comes after comment in the displays, presumably because that's the order in the code (?)). Changing their order in the code should be pretty innocuous. Could you try that? Thanks.
I wasn't clear enough in my previous post. DC.description, RDFS.comment, SKOS.definition and SDO.description triples are not rendered into HTML. What's rendered into HTML are the DCTERMS.description triples that are generated as surrogates for the DC.description, etc.
I'll see if there's some way to flip the order in which skos:definition and rdfs:comment triples are displayed.
OK, that was easier than I expected (and deserve). You can change the order in which the triples display by changing the order in which the DCTERMS.description surrogates are generated.
I now have a repo on my local system which does what you want -- at least in this respect.
Do you think it makes sense to submit a pull request against the official repo?
Thanks, Graeme,
A pull request would answer the question: does anyone object to this change? If they do, or if it takes a very long time, could you have an unofficial version that we run for our draft purposes?
Also, I need to figure out where we can put this for public access. I'll ask Nishad for advice. (He's the DC web and other stuff manager.)
I created a private repository for the changes at https://github.com/lagbolt/pyLODE. Karen, I added you so you should be able to see/download it. I'll add anyone else who's interested.
To take advantage of the change, you MUST use cli.py, because I didn't rebuild any of the executables.
Thank you, @lagbolt! However, I don't know how to "use cli.py" - if that is something you can explain in a few steps, I'll give it a go. In the meanwhile, if you could email me a copy of the HTML output, I will put that somewhere for the group to see.
This has been done and is the HTML file in the openwemi/docs directory that documents the vocabulary.