UNDER CONSTRUCTION
This is code aimed at providing simple knowledge representation within IGraph-compliant models. Among other things it supports default logic.
This is a cljc library and should be able to run under clj and cljs.
Watch this space for more complete documentation as the project matures.
To clean all compiled files:
lein clean
To create a production build run:
lein do clean, cljsbuild once min
Let me appropriate the Pizza tutorial used by the OWL-editing platform Protege. Being OWL, the protege version does not support default logic.
Here are the offerings for our imaginary pizza shop:
(def pizza-world
(add proto/ontology
...
So here we've set up the basic set of choices for building a pizza.
The Pizza prototype has two parameters: hasBase and hasTopping, meaning that to fully specified, any description elaborating Pizza should specify at least one value for each of these two properties.
Now we can define basic types of pizza...
))
The ThickCrustPizza elaborates Pizza, specifying that hasBase is ThickCrust. Note that it is still unspecified and therefore schematic for hasTopping at this stage of elaboration.
Then both vegetarian and carnivore pizzas elaborate the description of ThickCrustPizza to specify the respective toppings.
The chain of elaboration from each of these up to the root Pizza prototype resolves to a fully specified description of a Pizza because it specifies each of the parameters.
Now let's say you order a VegetarianPizza, but you want a thin crust and anchovies.
...
[:pizza/Order123
:proto/elaborates :pizza/VegetarianPizza
:pizza/hasBase :pizza/ThinCrust
:pizza/hasTopping :pizza/Anchovies
]
Since hasBase is declared above to have an occlusive aggregation policy, ThinCrust overrides the original ThickCrust specification.
Since hasTopping is declared as an inclusive property, anchovies are added in addition the other toppings.
lein test for clj
lein doo node test once for cljs under node
Copyright © 2019 Eric D. Scott
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.