Hi Michel, This looks like a question that I call “Explicit Rules vs Data-Driven Rules”. Both make sense depending on circumstance. I use data-driven when there are going to be hundreds of rules and explicit if there are going to be say 10 rules and it’s likely I can copy and paste and edit when creating new ones. Data-driven is also better if there is staff available to whom you can turn over the the data creation task since it requires no SHACL or rule-writing skills (e.g. often the “data” can be managed as a spreadsheet with a simple spreadsheet importer to turn it into the input triples).
Cheers, David > On 9 Jun 2021, at 08:02, 'Bohms, H.M. (Michel)' via TopBraid Suite Users > <[email protected]> wrote: > > In a project we see 2 options of modelling the rule based knowledge. > > Using shacl > > Model the rule in shacl-af (if a and b then c) > > Model the rule as metadata as kind of reference data fact (a,b,c) involving a > (one, generic) metarule in shacl-af selecting the apporriate fact > (just fyi > adam-shape:TemplateToInferMaatregelComplex a sh:NodeShape ; > sh:targetClass adam-o:Maatregel ; > sh:rule [ > a sh:SPARQLRule ; > sh:prefixes adam-p:, adam-ex:, rdf: ; > sh:construct """ > CONSTRUCT { > $this ?p ?o . > } > WHERE { > $this rdf:type > ?type . > FILTER > (!STRSTARTS(STR($this),STR(adam-ex:))). > > > ?bouwdeel_instance adam-p:heeftMaatregel $this . > > ?bouwdeel_instance rdf:type ?bouwdeel_type . > > ?bouwdeel_instance adam-p:heeftMateriaal ?bouwdeel_materiaal . > > > ?ref_mat > rdf:type ?type . > FILTER > (STRSTARTS(STR(?ref_mat),STR(adam-ex:))). > ?ref_bouwdeel > adam-p:heeftMaatregel ?ref_mat . > FILTER > (STRSTARTS(STR(?ref_mat),STR(adam-ex:))). > ?ref_bouwdeel > rdf:type ?bouwdeel_type . > ?ref_bouwdeel > adam-p:heeftMateriaal ?bouwdeel_materiaal . > > ?ref_mat ?p ?o > . > } > """ > ] . > > Working on metadata like: > > ex:Goed_Reling_2_with_two_Maatregels > rdf:type adam-o:Reling ; > adam-p:heeftMaatregel ex:Goed_ConserveringOverlagen_2 ; > adam-p:heeftMaatregel ex:Goed_GrootOnderhoud_3 ; > adam-p:heeftMateriaal adam-vwl:Staal ; > adam-p:oppervlakte "110"^^xsd:decimal ; > . > ) > > Now question is: what is best, futureproof option (well assuming the shacl-af > will be a recommendationanyway). > Option 1 seems more standard. Option 2 more particular but involving an an > efficient meta-rule as kind of template-rule. > > Can you think of any pros/cons that can help us decide? > > Thx a lot, Michel > > > Dr. ir. H.M. (Michel) Bohms > Scientist Specialist > Structural Reliability > T +31 (0)88 866 31 07 > M +31 (0)63 038 12 20 > E [email protected] <mailto:[email protected]> > Location <http://www.tno.nl/locations/DTS> > > > <image001.gif> <http://www.tno.nl/> > This message may contain information that is not intended for you. If you are > not the addressee or if this message was sent to you by mistake, you are > requested to inform the sender and delete the message. TNO accepts no > liability for the content of this e-mail, for the manner in which you use it > and for damage of any kind resulting from the risks inherent to the > electronic transmission of messages. > > > -- > You received this message because you are subscribed to the Google Groups > "TopBraid Suite Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/topbraid-users/a11d863970fc474486aafda7869344ca%40tno.nl > > <https://groups.google.com/d/msgid/topbraid-users/a11d863970fc474486aafda7869344ca%40tno.nl?utm_medium=email&utm_source=footer>. UK +44 (0) 7788 561308 US +1 (336) 283-0808 -- You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" 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/topbraid-users/28126EA5-B03F-44F9-813D-C0E137119203%40topquadrant.com.
