RDF Ontology for Program Code
Created on 2022-06-16T14:46:02-05:00
Modules, objects, methods and functions can just be defined as nodes and related as usual.
Parameters are an obnoxious case.
Storing parameters in a collection is a neat idea since those are ordered. Hand writing sucks less that way. Not sure how efficiently this kind of thing can be stored or worked with though. Especially a collection of blank nodes is obnoxious to query and isn't making strong use of a triple store's strengths.
LV2
LV2 approaches this by some "lv2:parameter" predicate which relates the object to blank nodes that define each parameter. The parameter then holds an lv2:index indicating the index of the data port. This requires each parameter to store its positional information explicitly which sucks for hand writing but is very servicable for indexing.