The CIDOC CRM extension doc pages (e.g. CRMtex) don't have the dang buttons for showing the inheritence graph and inherited properties. Learning the ontology is really freakin hard without those. This hack adds them in.
- Download the necessary assets from CRMtex
- HTML source: view page source, copy, and paste it into crmtex.html.orig
cidoc_scripts.js
: grab it from the devtools network panel
- Prefix all the URLs in the HTML
<head>
withhttps://cidoc-crm.org/
- We can still use them, but those links need to be fully-qualified now
- Manually insert the AJAX-fetched schema file
- When the page loads, it downloads an XML schema file from their server. Open the dev tools network tab, filter to Fetch/XHR, and refresh the page. You'll see a request to something like https://cidoc-crm.org/extensions/crmtex/html/CRMtex_v2.0.xml?v=20240213_122815
- Copy the response and paste it in as the value for
xmlFile
at its declaration near the top ofcidoc_scripts.js
- CRMtex also depends on CIDOC, CRMinf, CRMSci, and FRBRoo. To get stuff from those ontologies to show up
with names in the graph, paste their schema definitions into
xmlFile
too- For all of the dependency schemas except CRMinf and FRBRoo, there are published doc sites using the same tech, so those sites also AJAX in XML files:
- For each of these, extract their classes and properties and insert them into the appropriate
parent tags in
xmlFile
- Also add
external="true"
to each of their main parent tags. This is used by some of the code modifications to point links at their docs sites rather than internal anchors. - Manually write and add class blocks to the XML for the 2-3 CRMinf and FRBRoo classes
- Change the link in the
<head>
to point to/cidoc_scripts.js
. To see details of the modifications, look at the git log - Run the python script on the downloaded HTML page:
python main.py crmtext.html.orig > docs/crmtex.html
You're done!