Thank you, Holger! I appreciate your assistance. GaBriella Branson Wildland Fire Data Management Program - Knowledge Manager
Stay Connected! Sign up to receive email updates from the Wildland Fire Data Management Program<https://public.govdelivery.com/accounts/USDOI/subscriber/new?qsp=USDOI_6> [cid:image001.png@01D90A2B.7A074AB0] From: topbraid-users@googlegroups.com <topbraid-users@googlegroups.com> On Behalf Of Holger Knublauch Sent: Friday, December 2, 2022 1:01 AM To: topbraid-users@googlegroups.com Subject: Re: [EXTERNAL] [topbraid-users] Help Writing Inferences As another point of reference, the ADS help pages contain a chapter on sh:values rules: Using ADS with SHACL - edg-documentation 7.4.0 documentation<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.topquadrant.com%2Fdoc%2F7.4%2Fscripting%2Fshacl.html%23inferring-values&data=05%7C01%7Cgabriella_branson%40ios.doi.gov%7C846e04ac71b1455c43b008dad44c7160%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C638055722060394102%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JM9DpjNLXTBxL2SR2PVgs%2BDNEKcU9wOHBXILiOs5rxQ%3D&reserved=0> archive.topquadrant.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.topquadrant.com%2Fdoc%2F7.4%2Fscripting%2Fshacl.html%23inferring-values&data=05%7C01%7Cgabriella_branson%40ios.doi.gov%7C846e04ac71b1455c43b008dad44c7160%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C638055722060394102%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JM9DpjNLXTBxL2SR2PVgs%2BDNEKcU9wOHBXILiOs5rxQ%3D&reserved=0> [ED5961D3-7777-4B8D-9EE7-75D726564198]<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.topquadrant.com%2Fdoc%2F7.4%2Fscripting%2Fshacl.html%23inferring-values&data=05%7C01%7Cgabriella_branson%40ios.doi.gov%7C846e04ac71b1455c43b008dad44c7160%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C638055722060394102%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JM9DpjNLXTBxL2SR2PVgs%2BDNEKcU9wOHBXILiOs5rxQ%3D&reserved=0> Holger On 30 Nov 2022, at 9:53 am, Holger Knublauch <hol...@topquadrant.com<mailto:hol...@topquadrant.com>> wrote: For the record I am also attaching the whole example (using the JavaScript solution). <wftech.ttl> and here is the proof that it works in principle: <PastedGraphic-1.png> Holger On 30 Nov 2022, at 9:41 am, Holger Knublauch <hol...@topquadrant.com<mailto:hol...@topquadrant.com>> wrote: Hi GaBriella, the example that I had sent in my email was in Turtle notation, which you can edit on the Source Code tab of TopBraid EDG. To enter the sh:values rule, select the property shape and switch to the Source Code panel. Then paste the sh:values snippet so that it looks as follows: wftech:AuthoritativeDataSourceDeclarationView-sponsoredInvestment a sh:PropertyShape ; sh:path wftech:sponsoredInvestment ; sh:datatype xsd:boolean ; sh:maxCount 1 ; sh:name "sponsored investment" ; sh:values [ sh:exists [ sh:path wftech:systemOwner ; ] ; ] ; . It will then display like this on the form: <PastedGraphic-1.png> We do not have a dedicated editor for such sh:values rules in SHACL node expression syntax, so Source Code is the only option. >From the error message that you mention, it seems you have pasted the source >code into the default editor for sh:values that shows up on the form. That is >however expecting JavaScript source code, not Turtle. If you want to use >JavaScript instead of the SHACL syntax above, you can paste the following: <PastedGraphic-2.png> which would be another way of deriving the boolean for the case that the systemOwner property has any value. If you want to use the example above, also go the Home asset of your Ontology and switch to the Script API tab, then enter wftech as shown: <PastedGraphic-3.png> This makes sure that the wftech constant is known to the JavaScript API. You may need to press refresh on the Script Editor panel to activate that. HTH Holger On 30 Nov 2022, at 12:21 am, 'Branson, GaBriella C' via TopBraid Suite Users <topbraid-users@googlegroups.com<mailto:topbraid-users@googlegroups.com>> wrote: Hi Holger, Thank you for the link and sample code. I've tried several variations and am doing something wrong. Here is the latest: wftech:AuthoritativeDataSourceDeclarationView a sh:NodeShape ; sh:property wftech:AuthoritativeSourceDeclarationView-sponsoredInvestment ; . wftech:AuthoritativeSourceDeclarationView-sponsoredInvestment a sh:PropertyShape ; sh:path wftech:sponsoredInvestment ; sh:datatype xsd:boolean ; sh:values [ sh:exists [ sh:path wftech:systemOwner ; ] ; ] . wftech = my prefix AuthoritativeDataSourceDeclarationView = the node shape And this is the error I get: (I tried to compare what I had done versus your sample to ensure I had all the correct punctuation and I didn't notice any missing, but it sure seems to think it wants some more semi-colons ) <image003.png> I took out owl:class because my type is only a node shape. <image001.png> Perhaps I need to schedule a call and use support hours? GaBriella Branson Wildland Fire Data Management Program - Knowledge Manager Stay Connected! Sign up to receive email updates from the Wildland Fire Data Management Program<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.govdelivery.com%2Faccounts%2FUSDOI%2Fsubscriber%2Fnew%3Fqsp%3DUSDOI_6&data=05%7C01%7Cgabriella_branson%40ios.doi.gov%7C846e04ac71b1455c43b008dad44c7160%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C638055722060394102%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JzmjKDwF09VTxm0X%2FdZ5SsPkngK5kSdGQm8EtwTI4es%3D&reserved=0> <image002.png> From: topbraid-users@googlegroups.com<mailto:topbraid-users@googlegroups.com> <topbraid-users@googlegroups.com<mailto:topbraid-users@googlegroups.com>> On Behalf Of Holger Knublauch Sent: Tuesday, November 29, 2022 12:11 AM To: topbraid-users@googlegroups.com<mailto:topbraid-users@googlegroups.com> Subject: [EXTERNAL] Re: [topbraid-users] Help Writing Inferences This email has been received from outside of DOI - Use caution before clicking on links, opening attachments, or responding. Hi GaBriella, you can use SHACL Advanced Features to infer values. For your use cases, sh:values rules sound like a good match. See https://datashapes.org/forms.html#inferred-values<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdatashapes.org%2Fforms.html%23inferred-values&data=05%7C01%7Cgabriella_branson%40ios.doi.gov%7C846e04ac71b1455c43b008dad44c7160%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C638055722060394102%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hYOQOMoJ4GYVTjFPEZV%2BSUIQ5J9cFj1CTtRauXZ19zY%3D&reserved=0> for the basic mechanism. In your case, maybe this helps: ex:MyClass a owl:Class, sh:NodeShape ; sh:property ex:MyClass-sponsoredInvestment ; . ex:MyClass-sponsoredInvestment a sh:PropertyShape ; sh:path ex:sponsoredInvestment ; sh:datatype xsd:boolean ; sh:values [ sh:exists [ sh:path ex:systemOwner ; ] ; ] . This would mark "sponsoredInvestment" as a read-only property that will be automatically computed when displayed and queried, esp on forms, through GraphQL and through JavaScript/ADS. Such sh:values rules can also be expressed in SPARQL or JavaScript/ADS. Feel free to post your follow-up questions if you need more instructions. Holger On 29 Nov 2022, at 1:02 am, 'GaBriella Branson' via TopBraid Suite Users <topbraid-users@googlegroups.com<mailto:topbraid-users@googlegroups.com>> wrote: Hello, I have a series of 10 boolean attributes. I would like "true" to be inferred if another property has a value. As an example if systemOwner has any value, then sponsoredInvestment is true An additional example if hostedOn matches NIFC eNet or Denver Federal Center or WRCC, then enterpriseArchitectureSupportedDevelopmentEnvironment is true, but if hostedOn is AWS or Desktop or ESRI Cloud or null, then enterpriseArchitectureSupportedDevelopmentEnvironment is false Is this a legitimate use of inferrencing or should I handle this a different way? Do you have any recommendations on courses or resources I can use to write these? Thanks in advance! -- 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 topbraid-users+unsubscr...@googlegroups.com<mailto:topbraid-users+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/0cdd2f9d-85dc-43e9-ac81-5f6382513f28n%40googlegroups.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Ftopbraid-users%2F0cdd2f9d-85dc-43e9-ac81-5f6382513f28n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cgabriella_branson%40ios.doi.gov%7C846e04ac71b1455c43b008dad44c7160%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C638055722060394102%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=tLfhG%2FF1IRoLVlpTUAlbTAJAQgds%2BfTsQu%2FdvCYTN6w%3D&reserved=0>. -- 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 topbraid-users+unsubscr...@googlegroups.com<mailto:topbraid-users+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/8A55465A-F45A-44A5-B0F3-C796D108AB92%40topquadrant.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Ftopbraid-users%2F8A55465A-F45A-44A5-B0F3-C796D108AB92%2540topquadrant.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cgabriella_branson%40ios.doi.gov%7C846e04ac71b1455c43b008dad44c7160%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C638055722060394102%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=dySxCZdnl4JREN243AkGdt%2FiPLiKMq1vzhbeeu%2FKixQ%3D&reserved=0>. -- 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 topbraid-users+unsubscr...@googlegroups.com<mailto:topbraid-users+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CO6PR09MB7319A0292DAB4E81F8F06401DA159%40CO6PR09MB7319.namprd09.prod.outlook.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Ftopbraid-users%2FCO6PR09MB7319A0292DAB4E81F8F06401DA159%2540CO6PR09MB7319.namprd09.prod.outlook.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cgabriella_branson%40ios.doi.gov%7C846e04ac71b1455c43b008dad44c7160%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C638055722060394102%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=J4FFu5rqMlAHBl4BQzQfr6GupokYkjPdx3pqb338I54%3D&reserved=0>. -- 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 topbraid-users+unsubscr...@googlegroups.com<mailto:topbraid-users+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/36AE4280-B8BA-43A7-8582-95FCCA0E1296%40topquadrant.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Ftopbraid-users%2F36AE4280-B8BA-43A7-8582-95FCCA0E1296%2540topquadrant.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cgabriella_branson%40ios.doi.gov%7C846e04ac71b1455c43b008dad44c7160%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C638055722060394102%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3fpkrrJbdzClRSx%2BUNzX2r3PLVQjXHrX%2FB%2BSPTVFcg4%3D&reserved=0>. -- 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 topbraid-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CO6PR09MB73193B55C1BF65C68F5001A4DA1A9%40CO6PR09MB7319.namprd09.prod.outlook.com.