[topbraid-users] Asset Collection Samples

2024-04-17 Thread Христијан Станојоски
Hello,

I need the asset collection samples for Top Braid Composer ME, does anyone 
have them or have a link to download them because I am unable to find them 
on topquadrant's page.

Thank you in advance!

-- 
The topics of this mailing list include TopBraid EDG and related technologies 
such as SHACL.
To post to this group, send email to topbraid-users@googlegroups.com
--- 
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/e711ab98-954e-4a96-a341-c12110e2157an%40googlegroups.com.


Re: [topbraid-users] enum creation

2024-04-17 Thread Holger Knublauch


> On 17 Apr 2024, at 3:55 PM, 'Luis Enrique Ramos García' via TopBraid Suite 
> Users  wrote:
> 
> it works now in this ontology,
> 
> now, if I want to add a color in any instance (for testing purpose),
> it is only by modifying the code?, like this?:

If you have properly declared the color property then you should be able to 
select values from the form, not just source code.

Holger


> 
> 
> That is moreless the expected result on my end.
> 
> 
> Thanks,
> 
> 
> Luis
> 
> El mié, 17 abr 2024 a las 15:37, Holger Knublauch ( >) escribió:
>> Yes that looks right. To use it in traffic lights, just declare a color 
>> property there which has sh:class :Color.
>> 
>> Holger
>> 
>> 
>>> On 17 Apr 2024, at 3:00 PM, 'Luis Enrique Ramos García' via TopBraid Suite 
>>> Users >> > wrote:
>>> 
>>> sure,
>>> 
>>> I created a similar ontology for testing with same results, here is the 
>>> code:
>>> 
>>> tesontologyramosenum:Color
>>>   a owl:Class ;
>>>   a sh:NodeShape ;
>>>   rdfs:label "Color" ;
>>>   rdfs:subClassOf owl:Thing ;
>>>   sh:in (
>>>   tesontologyramosenum:Green
>>>   tesontologyramosenum:Yellow
>>>   tesontologyramosenum:Red
>>> ) ;
>>>   sh:property tesontologyramosenum:Color-label ;
>>> .
>>> 
>>> the screen shot is this:
>>> 
>>> 
>>> 
>>> 
>>> with similar results, a datatype property without labeling, and a group of 
>>> undeclared properties.
>>> 
>>> Is this the expected result?
>>> 
>>> How do I use this in traffic light instances, if that were the case?
>>> 
>>> 
>>> Luis
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> El mié, 17 abr 2024 a las 14:41, Holger Knublauch (>> >) escribió:
 Can you paste us the complete content of the source code panel, e.g. as a 
 screenshot? It's hard to see otherwise and there are syntax errors below.
 
 Holger
 
 
> On 17 Apr 2024, at 2:38 PM, 'Luis Enrique Ramos García' via TopBraid 
> Suite Users  > wrote:
> 
> I need only 3 elements in the enum,
> 
> But, I tried at the first the source code edition, and told you the 
> result I got:
> 
> **
> 
> 1. I tried to add the code by myself, but it seems there is something 
> wrong with the code:
> sh:in (
>   myontology:value1
>myontology _:value2
>   myontology :value3
> ) ;
> myontology:property1;
> myontology:property2;
> myontology:enumproperty;
> 
> Please, take in account that I edited the enum property just after the 
> sh:in, but the editor put it at the end
> of the list of properties.
> 
> Part of the result was this black datatype property in properties list
> 
> 
> 
> and in the undeclared property there is a list with these values:
> 
> in  [myontology:property1;
>   myontology:property1;
>   myontology:enumproperty;]
> 
> is thát the expected result?
> 
> **
> 
> 
> Luis
> 
> El mié, 17 abr 2024 a las 14:33, Holger Knublauch 
> (mailto:hol...@topquadrant.com>>) escribió:
>> 
>> 
>>> On 17 Apr 2024, at 2:30 PM, 'Luis Enrique Ramos García' via TopBraid 
>>> Suite Users >> > wrote:
>>> 
>>> Thanks for your quick answer,
>>> 
>>> But, dear, where should I add this code?.
>>> 
>>> Because I tried to add it in the source code panel, and it didn't work, 
>>> same with the script panel,
>>> where I expected it should work, but it did not.
>>> 
>>> So, I owner in which panel should I add this code?.
>>> 
>>> I do not have any idea how to use it.
>> 
>> Yes, it requires JS experience. There is no out-of-the-box solution for 
>> what you are trying to express.
>> 
>> How many enumerations do you need? If it's just a few, I would suggest 
>> going ahead with manual editing of sh:in lists in the Source Code.
>> 
>> Holger
>> 
>> 
>>> 
>>> 
>>> Luis
>>> 
>>> 
>>> 
>>> El mié, 17 abr 2024 a las 13:45, Holger Knublauch 
>>> (mailto:hol...@topquadrant.com>>) escribió:
 
 
> On 17 Apr 2024, at 1:38 PM, 'Luis Enrique Ramos García' via TopBraid 
> Suite Users  > wrote:
> 
> I am working with version Version: 7.5.1 (20230316-1531).
 
 Ok then the script may not work, assuming the 

Re: [topbraid-users] enum creation

2024-04-17 Thread 'Luis Enrique Ramos García' via TopBraid Suite Users
it works now in this ontology,

now, if I want to add a color in any instance (for testing purpose),
it is only by modifying the code?, like this?:

[image: image.png]
That is moreless the expected result on my end.


Thanks,


Luis

El mié, 17 abr 2024 a las 15:37, Holger Knublauch ()
escribió:

> Yes that looks right. To use it in traffic lights, just declare a color
> property there which has sh:class :Color.
>
> Holger
>
>
> On 17 Apr 2024, at 3:00 PM, 'Luis Enrique Ramos García' via TopBraid Suite
> Users  wrote:
>
> sure,
>
> I created a similar ontology for testing with same results, here is the
> code:
>
> tesontologyramosenum:Color
>   a owl:Class ;
>   a sh:NodeShape ;
>   rdfs:label "Color" ;
>   rdfs:subClassOf owl:Thing ;
>   sh:in (
>   tesontologyramosenum:Green
>   tesontologyramosenum:Yellow
>   tesontologyramosenum:Red
> ) ;
>   sh:property tesontologyramosenum:Color-label ;
> .
>
> the screen shot is this:
>
> 
> 
>
> with similar results, a datatype property without labeling, and a group of
> undeclared properties.
>
> Is this the expected result?
>
> How do I use this in traffic light instances, if that were the case?
>
>
> Luis
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> El mié, 17 abr 2024 a las 14:41, Holger Knublauch ()
> escribió:
>
>> Can you paste us the complete content of the source code panel, e.g. as a
>> screenshot? It's hard to see otherwise and there are syntax errors below.
>>
>> Holger
>>
>>
>> On 17 Apr 2024, at 2:38 PM, 'Luis Enrique Ramos García' via TopBraid
>> Suite Users  wrote:
>>
>> I need only 3 elements in the enum,
>>
>> But, I tried at the first the source code edition, and told you the
>> result I got:
>>
>>
>> **
>>
>> 1. I tried to add the code by myself, but it seems there is something
>> wrong with the code:
>> sh:in (
>>   myontology:value1
>>myontology _:value2
>>   myontology :value3
>> ) ;
>> myontology:property1;
>> myontology:property2;
>> myontology:enumproperty;
>>
>> Please, take in account that I edited the enum property just after the
>> sh:in, but the editor put it at the end
>> of the list of properties.
>>
>> Part of the result was this black datatype property in properties list
>>
>> 
>>
>> and in the undeclared property there is a list with these values:
>>
>> in  [myontology:property1;
>>   myontology:property1;
>>   myontology:enumproperty;]
>>
>> is thát the expected result?
>>
>>
>> **
>>
>>
>> Luis
>>
>> El mié, 17 abr 2024 a las 14:33, Holger Knublauch (<
>> hol...@topquadrant.com>) escribió:
>>
>>>
>>>
>>> On 17 Apr 2024, at 2:30 PM, 'Luis Enrique Ramos García' via TopBraid
>>> Suite Users  wrote:
>>>
>>> Thanks for your quick answer,
>>>
>>> But, dear, where should I add this code?.
>>>
>>> Because I tried to add it in the source code panel, and it didn't work,
>>> same with the script panel,
>>> where I expected it should work, but it did not.
>>>
>>> So, I owner in which panel should I add this code?.
>>>
>>> I do not have any idea how to use it.
>>>
>>>
>>> Yes, it requires JS experience. There is no out-of-the-box solution for
>>> what you are trying to express.
>>>
>>> How many enumerations do you need? If it's just a few, I would suggest
>>> going ahead with manual editing of sh:in lists in the Source Code.
>>>
>>> Holger
>>>
>>>
>>>
>>>
>>> Luis
>>>
>>>
>>>
>>> El mié, 17 abr 2024 a las 13:45, Holger Knublauch (<
>>> hol...@topquadrant.com>) escribió:
>>>


 On 17 Apr 2024, at 1:38 PM, 'Luis Enrique Ramos García' via TopBraid
 Suite Users  wrote:

 I am working with version Version: 7.5.1 (20230316-1531).


 Ok then the script may not work, assuming the RDFNodeUtil object was
 introduced later.

 In that case source code editing may be your best solution, unless you
 know how to use this


 createList: (nodes) => {
 let nil = graph.namedNode(rdf.NS + 'nil');
 if(nodes.length == 0) {
 return nil;
 }
 let root = graph.blankNode();
 let current = root;
 nodes.forEach((node, index) => {
 current.add(rdf.first, node);
 let rest = index < nodes.length - 1 ? graph.blankNode() : nil;
 current.add(rdf.rest, rest);
 current = rest;
 })
 return root;
 },



 I included an script panel, refreshed it, and I have this view:
 
 When I run the script I can see my class, the one for which I want to
 create the enum, is the result of focusNode.

 But, when I click in "Declare enumerations from instances" I get the
 same result again:

 
 I have a question:

 how does my script know from which class I do 

Re: [topbraid-users] Asserting inverse properties (skos:topConceptOf)

2024-04-17 Thread Steve Ray
OK, fair enough. I did think that you were saying that was a case where you
needed an explicit inverse relation.

Steve




On Wed, Apr 17, 2024 at 9:35 AM David Price  wrote:

> Sure Steve, that’s exactly what I was talking about …  I guess I did not
> word my reply very weill if it was confusing to you or anyone else.
>
> Cheers,
> David
>
> On 17 Apr 2024, at 14:21, Steve Ray  wrote:
>
> Actually, David, you don't need the explicit inverse even for cardinality
> constraints. Here's a snippet from a standard I'm working on:
>
> sh:property [
> sh:path [
> sh:inversePath s223:observes ;
> ] ;
> rdfs:comment "An instance of s223:Property must not be observed (set) by
> more than one entity." ;
> sh:maxCount 1 ;
> sh:message "s223: An instance of s223:Property must not be observed (set)
> by more than one entity." ;
> ] ;
>
> Steve
>
>
>
>
> On Wed, Apr 17, 2024 at 4:36 AM David Price 
> wrote:
>
>>
>>
>> On 17 Apr 2024, at 09:18, Holger Knublauch 
>> wrote:
>>
>> Hi Dan,
>>
>> yes this can be achieved through a dash:ChangeScript, see
>> https://archive.topquadrant.com/doc/latest/ext/points.html#change-and-commit-scripts
>>
>> Basically, such scripts are triggered after every change and may perform
>> additional changes. In this case, whenever a skos:hasTopConcept gets
>> asserted, it would need to assert the corresponding inverse triple. And the
>> same for deleting triples. To work consistently, it would need to operate
>> in both directions.
>>
>> Note that in contrast to ChangeScripts, inference rules such as sh:values
>> rules are only computed on demand and not persisted. They are only computed
>> to populate the user interface, for example when you look at the narrower
>> concepts that render as inverse of skos:broader triples. We only store
>> these in one direction, and do so intentionally because having an inverse
>> triple is just adding extra costs and drive up the maintenance burden as it
>> is easy to get into situations where the two directions become out of
>> synch. Therefore we strongly discourage using explicit inverse triples,
>> instead preferring sh:inversePath declarations.
>>
>>
>> Holger is 100% right on the “discourage using explicit inverse triples”
>> idea. They are nearly impossible to keep synch’d and we have recent
>> customer situations where we had to “undo” that mistake as part of a data
>> model V2 and related data migration.
>>
>> In my personal opinion, introducing inverse properties with OWL was a
>> major mistake, and it got unfortunately propagated into SKOS too. As RDF
>> triples are symmetric between subjects and objects, and graphs can be
>> walked in both directions equally.
>>
>>
>> From a modeller’s perspective the main “good” reason to include inverse
>> properties in SHACL it is so that the reverse property can have cardinality
>> constraints. That need does pop up, so almost all data modelling
>> languages/standards support the idea of inverse relations with cardinality.
>> It’s not specific to RDF-land.
>>
>> Cheers,
>> David
>>
>> Do you have downstream tools that require these explicit inverse triples?
>>
>>
>> Holger
>>
>>
>> On 16 Apr 2024, at 8:03 PM, Dan Segal  wrote:
>>
>> Is there a way to assert an inverse property into the source code of a
>> concept?
>>
>> For example, where we have:
>>
>> *conceptScheme skos:hasTopConcept concept*
>>
>> we want to assert:
>>
>> *concept skos:topConceptOf conceptScheme*
>>
>> Since *skos:topConceptOf* is defined as the inverse of *skos:hasTopConcept,
>> *the relationship displays in the form view.   However, we want to
>> assert the statement so that the triple *concept skos:topConceptOf
>> conceptScheme* is written to the RDF.
>>
>> Have tried a property rule, as well executing inference rules.  Neither
>> results in the inverse relationship being written to RDF.
>>
>> Thank you
>>
>>
>>
>>
>>
>>
>>
>> --
>> The topics of this mailing list include TopBraid EDG and related
>> technologies such as SHACL.
>> To post to this group, send email to topbraid-users@googlegroups.com
>> ---
>> 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/c4724215-481a-4c08-960b-7c29ffb16169n%40googlegroups.com
>> 
>> .
>>
>>
>>
>> --
>> The topics of this mailing list include TopBraid EDG and related
>> technologies such as SHACL.
>> To post to this group, send email to topbraid-users@googlegroups.com
>> ---
>> 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 

Re: [topbraid-users] enum creation

2024-04-17 Thread Holger Knublauch
Yes that looks right. To use it in traffic lights, just declare a color 
property there which has sh:class :Color.

Holger


> On 17 Apr 2024, at 3:00 PM, 'Luis Enrique Ramos García' via TopBraid Suite 
> Users  wrote:
> 
> sure,
> 
> I created a similar ontology for testing with same results, here is the code:
> 
> tesontologyramosenum:Color
>   a owl:Class ;
>   a sh:NodeShape ;
>   rdfs:label "Color" ;
>   rdfs:subClassOf owl:Thing ;
>   sh:in (
>   tesontologyramosenum:Green
>   tesontologyramosenum:Yellow
>   tesontologyramosenum:Red
> ) ;
>   sh:property tesontologyramosenum:Color-label ;
> .
> 
> the screen shot is this:
> 
> 
> 
> 
> with similar results, a datatype property without labeling, and a group of 
> undeclared properties.
> 
> Is this the expected result?
> 
> How do I use this in traffic light instances, if that were the case?
> 
> 
> Luis
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> El mié, 17 abr 2024 a las 14:41, Holger Knublauch ( >) escribió:
>> Can you paste us the complete content of the source code panel, e.g. as a 
>> screenshot? It's hard to see otherwise and there are syntax errors below.
>> 
>> Holger
>> 
>> 
>>> On 17 Apr 2024, at 2:38 PM, 'Luis Enrique Ramos García' via TopBraid Suite 
>>> Users >> > wrote:
>>> 
>>> I need only 3 elements in the enum,
>>> 
>>> But, I tried at the first the source code edition, and told you the result 
>>> I got:
>>> 
>>> **
>>> 
>>> 1. I tried to add the code by myself, but it seems there is something wrong 
>>> with the code:
>>> sh:in (
>>>   myontology:value1
>>>myontology _:value2
>>>   myontology :value3
>>> ) ;
>>> myontology:property1;
>>> myontology:property2;
>>> myontology:enumproperty;
>>> 
>>> Please, take in account that I edited the enum property just after the 
>>> sh:in, but the editor put it at the end
>>> of the list of properties.
>>> 
>>> Part of the result was this black datatype property in properties list
>>> 
>>> 
>>> 
>>> and in the undeclared property there is a list with these values:
>>> 
>>> in  [myontology:property1;
>>>   myontology:property1;
>>>   myontology:enumproperty;]
>>> 
>>> is thát the expected result?
>>> 
>>> **
>>> 
>>> 
>>> Luis
>>> 
>>> El mié, 17 abr 2024 a las 14:33, Holger Knublauch (>> >) escribió:
 
 
> On 17 Apr 2024, at 2:30 PM, 'Luis Enrique Ramos García' via TopBraid 
> Suite Users  > wrote:
> 
> Thanks for your quick answer,
> 
> But, dear, where should I add this code?.
> 
> Because I tried to add it in the source code panel, and it didn't work, 
> same with the script panel,
> where I expected it should work, but it did not.
> 
> So, I owner in which panel should I add this code?.
> 
> I do not have any idea how to use it.
 
 Yes, it requires JS experience. There is no out-of-the-box solution for 
 what you are trying to express.
 
 How many enumerations do you need? If it's just a few, I would suggest 
 going ahead with manual editing of sh:in lists in the Source Code.
 
 Holger
 
 
> 
> 
> Luis
> 
> 
> 
> El mié, 17 abr 2024 a las 13:45, Holger Knublauch 
> (mailto:hol...@topquadrant.com>>) escribió:
>> 
>> 
>>> On 17 Apr 2024, at 1:38 PM, 'Luis Enrique Ramos García' via TopBraid 
>>> Suite Users >> > wrote:
>>> 
>>> I am working with version Version: 7.5.1 (20230316-1531).
>> 
>> Ok then the script may not work, assuming the RDFNodeUtil object was 
>> introduced later.
>> 
>> In that case source code editing may be your best solution, unless you 
>> know how to use this
>> 
>> 
>> createList: (nodes) => {
>> let nil = graph.namedNode(rdf.NS + 'nil');
>> if(nodes.length == 0) {
>> return nil;
>> }
>> let root = graph.blankNode();
>> let current = root;
>> nodes.forEach((node, index) => {
>> current.add(rdf.first, node);
>> let rest = index < nodes.length - 1 ? graph.blankNode() : 
>> nil;
>> current.add(rdf.rest, rest);
>> current = rest;
>> })
>> return root;
>> },
>> 
>> 
>>> 
>>> I included an script panel, refreshed it, and I have this view:
>>> 
>>> When I run the script I can see my class, the one for which I 

Re: [topbraid-users] Asserting inverse properties (skos:topConceptOf)

2024-04-17 Thread David Price
Sure Steve, that’s exactly what I was talking about …  I guess I did not word 
my reply very weill if it was confusing to you or anyone else.

Cheers,
David

> On 17 Apr 2024, at 14:21, Steve Ray  wrote:
> 
> Actually, David, you don't need the explicit inverse even for cardinality 
> constraints. Here's a snippet from a standard I'm working on:
> 
>   sh:property [
>   sh:path [
>   sh:inversePath s223:observes ;
> ] ;
>   rdfs:comment "An instance of s223:Property must not be observed (set) 
> by more than one entity." ;
>   sh:maxCount 1 ;
>   sh:message "s223: An instance of s223:Property must not be observed 
> (set) by more than one entity." ;
> ] ;
> 
> Steve
> 
> 
> 
> 
> On Wed, Apr 17, 2024 at 4:36 AM David Price  > wrote:
>> 
>> 
>>> On 17 Apr 2024, at 09:18, Holger Knublauch >> > wrote:
>>> 
>>> Hi Dan,
>>> 
>>> yes this can be achieved through a dash:ChangeScript, see 
>>> https://archive.topquadrant.com/doc/latest/ext/points.html#change-and-commit-scripts
>>> 
>>> Basically, such scripts are triggered after every change and may perform 
>>> additional changes. In this case, whenever a skos:hasTopConcept gets 
>>> asserted, it would need to assert the corresponding inverse triple. And the 
>>> same for deleting triples. To work consistently, it would need to operate 
>>> in both directions.
>>> 
>>> Note that in contrast to ChangeScripts, inference rules such as sh:values 
>>> rules are only computed on demand and not persisted. They are only computed 
>>> to populate the user interface, for example when you look at the narrower 
>>> concepts that render as inverse of skos:broader triples. We only store 
>>> these in one direction, and do so intentionally because having an inverse 
>>> triple is just adding extra costs and drive up the maintenance burden as it 
>>> is easy to get into situations where the two directions become out of 
>>> synch. Therefore we strongly discourage using explicit inverse triples, 
>>> instead preferring sh:inversePath declarations.
>>> 
>> 
>> Holger is 100% right on the “discourage using explicit inverse triples” 
>> idea. They are nearly impossible to keep synch’d and we have recent customer 
>> situations where we had to “undo” that mistake as part of a data model V2 
>> and related data migration.
>> 
>>> In my personal opinion, introducing inverse properties with OWL was a major 
>>> mistake, and it got unfortunately propagated into SKOS too. As RDF triples 
>>> are symmetric between subjects and objects, and graphs can be walked in 
>>> both directions equally.
>>> 
>> 
>> From a modeller’s perspective the main “good” reason to include inverse 
>> properties in SHACL it is so that the reverse property can have cardinality 
>> constraints. That need does pop up, so almost all data modelling 
>> languages/standards support the idea of inverse relations with cardinality. 
>> It’s not specific to RDF-land.
>> 
>> Cheers,
>> David
>> 
>>> Do you have downstream tools that require these explicit inverse triples?
>>> 
>>> Holger
>>> 
>>> 
 On 16 Apr 2024, at 8:03 PM, Dan Segal >>> > wrote:
 
 Is there a way to assert an inverse property into the source code of a 
 concept?
 
 For example, where we have:
 
 conceptScheme skos:hasTopConcept concept
 
 we want to assert:
 
 concept skos:topConceptOf conceptScheme
 
 Since skos:topConceptOf is defined as the inverse of skos:hasTopConcept, 
 the relationship displays in the form view.   However, we want to assert 
 the statement so that the triple concept skos:topConceptOf conceptScheme 
 is written to the RDF.
 
 Have tried a property rule, as well executing inference rules.  Neither 
 results in the inverse relationship being written to RDF.
 
 Thank you
 
 
 
 
 
 
 
 -- 
 The topics of this mailing list include TopBraid EDG and related 
 technologies such as SHACL.
 To post to this group, send email to topbraid-users@googlegroups.com 
 
 --- 
 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/c4724215-481a-4c08-960b-7c29ffb16169n%40googlegroups.com
  
 .
>>> 
>>> 
>>> -- 
>>> The topics of this mailing list include TopBraid EDG and related 
>>> technologies such as SHACL.
>>> To post to this group, send email 

Re: [topbraid-users] enum creation

2024-04-17 Thread 'Luis Enrique Ramos García' via TopBraid Suite Users
David,

With your recommendation, now at least I can see the following in the
object property:

[image: image.png]
I created an instance of traffic light, and added the property Color-label
to traffic light as domain,

but when I create the instance of the class traffic light, what I expect is
to have the possibility of

viewing the three possible colors for my traffic light, however I can not
visualize it.

[image: image.png]
previous property name was "label"


Luis


El mié, 17 abr 2024 a las 15:04, David Price ()
escribió:

> Need the sh:in do be defined in PropertyShaps, not NodeShape.
>
> Example from eariler:
>
> example_schema:ThingWithStatus-hasStatus
>   a *sh:PropertyShape ;*
>   sh:path example_schema:hasStatus ;
>   sh:class example_schema:Status ;
>   sh:description "only Active or Retired allowed" ;
>   sh:in (
>   example_schema:Active
>   example_schema:Retired
> ) ;
>   sh:maxCount 1 ;
>   sh:name "has status" ;
> .
>
>
> Cheers,
> David
>
> On 17 Apr 2024, at 14:00, 'Luis Enrique Ramos García' via TopBraid Suite
> Users  wrote:
>
> sure,
>
> I created a similar ontology for testing with same results, here is the
> code:
>
> tesontologyramosenum:Color
>   a owl:Class ;
>   a sh:NodeShape ;
>   rdfs:label "Color" ;
>   rdfs:subClassOf owl:Thing ;
>   sh:in (
>   tesontologyramosenum:Green
>   tesontologyramosenum:Yellow
>   tesontologyramosenum:Red
> ) ;
>   sh:property tesontologyramosenum:Color-label ;
> .
>
> the screen shot is this:
>
> 
> 
>
> with similar results, a datatype property without labeling, and a group of
> undeclared properties.
>
> Is this the expected result?
>
> How do I use this in traffic light instances, if that were the case?
>
>
> Luis
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> El mié, 17 abr 2024 a las 14:41, Holger Knublauch ()
> escribió:
>
>> Can you paste us the complete content of the source code panel, e.g. as a
>> screenshot? It's hard to see otherwise and there are syntax errors below.
>>
>> Holger
>>
>>
>> On 17 Apr 2024, at 2:38 PM, 'Luis Enrique Ramos García' via TopBraid
>> Suite Users  wrote:
>>
>> I need only 3 elements in the enum,
>>
>> But, I tried at the first the source code edition, and told you the
>> result I got:
>>
>>
>> **
>>
>> 1. I tried to add the code by myself, but it seems there is something
>> wrong with the code:
>> sh:in (
>>   myontology:value1
>>myontology _:value2
>>   myontology :value3
>> ) ;
>> myontology:property1;
>> myontology:property2;
>> myontology:enumproperty;
>>
>> Please, take in account that I edited the enum property just after the
>> sh:in, but the editor put it at the end
>> of the list of properties.
>>
>> Part of the result was this black datatype property in properties list
>>
>> 
>>
>> and in the undeclared property there is a list with these values:
>>
>> in  [myontology:property1;
>>   myontology:property1;
>>   myontology:enumproperty;]
>>
>> is thát the expected result?
>>
>>
>> **
>>
>>
>> Luis
>>
>> El mié, 17 abr 2024 a las 14:33, Holger Knublauch (<
>> hol...@topquadrant.com>) escribió:
>>
>>>
>>>
>>> On 17 Apr 2024, at 2:30 PM, 'Luis Enrique Ramos García' via TopBraid
>>> Suite Users  wrote:
>>>
>>> Thanks for your quick answer,
>>>
>>> But, dear, where should I add this code?.
>>>
>>> Because I tried to add it in the source code panel, and it didn't work,
>>> same with the script panel,
>>> where I expected it should work, but it did not.
>>>
>>> So, I owner in which panel should I add this code?.
>>>
>>> I do not have any idea how to use it.
>>>
>>>
>>> Yes, it requires JS experience. There is no out-of-the-box solution for
>>> what you are trying to express.
>>>
>>> How many enumerations do you need? If it's just a few, I would suggest
>>> going ahead with manual editing of sh:in lists in the Source Code.
>>>
>>> Holger
>>>
>>>
>>>
>>>
>>> Luis
>>>
>>>
>>>
>>> El mié, 17 abr 2024 a las 13:45, Holger Knublauch (<
>>> hol...@topquadrant.com>) escribió:
>>>


 On 17 Apr 2024, at 1:38 PM, 'Luis Enrique Ramos García' via TopBraid
 Suite Users  wrote:

 I am working with version Version: 7.5.1 (20230316-1531).


 Ok then the script may not work, assuming the RDFNodeUtil object was
 introduced later.

 In that case source code editing may be your best solution, unless you
 know how to use this


 createList: (nodes) => {
 let nil = graph.namedNode(rdf.NS + 'nil');
 if(nodes.length == 0) {
 return nil;
 }
 let root = graph.blankNode();
 let current = root;
 nodes.forEach((node, index) => {
 current.add(rdf.first, node);
 let rest = 

Re: [topbraid-users] Asserting inverse properties (skos:topConceptOf)

2024-04-17 Thread Steve Ray
Actually, David, you don't need the explicit inverse even for cardinality
constraints. Here's a snippet from a standard I'm working on:

sh:property [
sh:path [
sh:inversePath s223:observes ;
] ;
rdfs:comment "An instance of s223:Property must not be observed (set) by
more than one entity." ;
sh:maxCount 1 ;
sh:message "s223: An instance of s223:Property must not be observed (set)
by more than one entity." ;
] ;

Steve




On Wed, Apr 17, 2024 at 4:36 AM David Price  wrote:

>
>
> On 17 Apr 2024, at 09:18, Holger Knublauch  wrote:
>
> Hi Dan,
>
> yes this can be achieved through a dash:ChangeScript, see
> https://archive.topquadrant.com/doc/latest/ext/points.html#change-and-commit-scripts
>
> Basically, such scripts are triggered after every change and may perform
> additional changes. In this case, whenever a skos:hasTopConcept gets
> asserted, it would need to assert the corresponding inverse triple. And the
> same for deleting triples. To work consistently, it would need to operate
> in both directions.
>
> Note that in contrast to ChangeScripts, inference rules such as sh:values
> rules are only computed on demand and not persisted. They are only computed
> to populate the user interface, for example when you look at the narrower
> concepts that render as inverse of skos:broader triples. We only store
> these in one direction, and do so intentionally because having an inverse
> triple is just adding extra costs and drive up the maintenance burden as it
> is easy to get into situations where the two directions become out of
> synch. Therefore we strongly discourage using explicit inverse triples,
> instead preferring sh:inversePath declarations.
>
>
> Holger is 100% right on the “discourage using explicit inverse triples”
> idea. They are nearly impossible to keep synch’d and we have recent
> customer situations where we had to “undo” that mistake as part of a data
> model V2 and related data migration.
>
> In my personal opinion, introducing inverse properties with OWL was a
> major mistake, and it got unfortunately propagated into SKOS too. As RDF
> triples are symmetric between subjects and objects, and graphs can be
> walked in both directions equally.
>
>
> From a modeller’s perspective the main “good” reason to include inverse
> properties in SHACL it is so that the reverse property can have cardinality
> constraints. That need does pop up, so almost all data modelling
> languages/standards support the idea of inverse relations with cardinality.
> It’s not specific to RDF-land.
>
> Cheers,
> David
>
> Do you have downstream tools that require these explicit inverse triples?
>
>
> Holger
>
>
> On 16 Apr 2024, at 8:03 PM, Dan Segal  wrote:
>
> Is there a way to assert an inverse property into the source code of a
> concept?
>
> For example, where we have:
>
> *conceptScheme skos:hasTopConcept concept*
>
> we want to assert:
>
> *concept skos:topConceptOf conceptScheme*
>
> Since *skos:topConceptOf* is defined as the inverse of *skos:hasTopConcept,
> *the relationship displays in the form view.   However, we want to assert
> the statement so that the triple *concept skos:topConceptOf conceptScheme*
> is written to the RDF.
>
> Have tried a property rule, as well executing inference rules.  Neither
> results in the inverse relationship being written to RDF.
>
> Thank you
>
>
>
>
>
>
>
> --
> The topics of this mailing list include TopBraid EDG and related
> technologies such as SHACL.
> To post to this group, send email to topbraid-users@googlegroups.com
> ---
> 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/c4724215-481a-4c08-960b-7c29ffb16169n%40googlegroups.com
> 
> .
>
>
>
> --
> The topics of this mailing list include TopBraid EDG and related
> technologies such as SHACL.
> To post to this group, send email to topbraid-users@googlegroups.com
> ---
> 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/67C9D2F5-C581-4F8E-AB40-CEB3A897DCBB%40topquadrant.com
> 
> .
>
>
> --
> The topics of this mailing list include TopBraid EDG and related
> technologies such as SHACL.
> To post to this group, send email to topbraid-users@googlegroups.com
> ---
> You received this message 

Re: [topbraid-users] enum creation

2024-04-17 Thread 'Luis Enrique Ramos García' via TopBraid Suite Users
Thanks or your answer David,

I did the following, but I do not see any change:

tesontologyramosenum:Color
  a owl:Class ;
  a sh:NodeShape ;
  rdfs:label "Color" ;
  rdfs:subClassOf owl:Thing ;
  sh:property tesontologyramosenum:Color-label ;
.
tesontologyramosenum:Color-label
  a sh:PropertyShape ;
  sh:path tesontologyramosenum:label ;
  sh:class tesontologyramosenum:Color ;
  sh:in (
  tesontologyramosenum:Green
  tesontologyramosenum:Yellow
  tesontologyramosenum:Red
) ;
  sh:name "label" ;
.

What should I be missing?


Luis






El mié, 17 abr 2024 a las 15:04, David Price ()
escribió:

> Need the sh:in do be defined in PropertyShaps, not NodeShape.
>
> Example from eariler:
>
> example_schema:ThingWithStatus-hasStatus
>   a *sh:PropertyShape ;*
>   sh:path example_schema:hasStatus ;
>   sh:class example_schema:Status ;
>   sh:description "only Active or Retired allowed" ;
>   sh:in (
>   example_schema:Active
>   example_schema:Retired
> ) ;
>   sh:maxCount 1 ;
>   sh:name "has status" ;
> .
>
>
> Cheers,
> David
>
> On 17 Apr 2024, at 14:00, 'Luis Enrique Ramos García' via TopBraid Suite
> Users  wrote:
>
> sure,
>
> I created a similar ontology for testing with same results, here is the
> code:
>
> tesontologyramosenum:Color
>   a owl:Class ;
>   a sh:NodeShape ;
>   rdfs:label "Color" ;
>   rdfs:subClassOf owl:Thing ;
>   sh:in (
>   tesontologyramosenum:Green
>   tesontologyramosenum:Yellow
>   tesontologyramosenum:Red
> ) ;
>   sh:property tesontologyramosenum:Color-label ;
> .
>
> the screen shot is this:
>
> 
> 
>
> with similar results, a datatype property without labeling, and a group of
> undeclared properties.
>
> Is this the expected result?
>
> How do I use this in traffic light instances, if that were the case?
>
>
> Luis
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> El mié, 17 abr 2024 a las 14:41, Holger Knublauch ()
> escribió:
>
>> Can you paste us the complete content of the source code panel, e.g. as a
>> screenshot? It's hard to see otherwise and there are syntax errors below.
>>
>> Holger
>>
>>
>> On 17 Apr 2024, at 2:38 PM, 'Luis Enrique Ramos García' via TopBraid
>> Suite Users  wrote:
>>
>> I need only 3 elements in the enum,
>>
>> But, I tried at the first the source code edition, and told you the
>> result I got:
>>
>>
>> **
>>
>> 1. I tried to add the code by myself, but it seems there is something
>> wrong with the code:
>> sh:in (
>>   myontology:value1
>>myontology _:value2
>>   myontology :value3
>> ) ;
>> myontology:property1;
>> myontology:property2;
>> myontology:enumproperty;
>>
>> Please, take in account that I edited the enum property just after the
>> sh:in, but the editor put it at the end
>> of the list of properties.
>>
>> Part of the result was this black datatype property in properties list
>>
>> 
>>
>> and in the undeclared property there is a list with these values:
>>
>> in  [myontology:property1;
>>   myontology:property1;
>>   myontology:enumproperty;]
>>
>> is thát the expected result?
>>
>>
>> **
>>
>>
>> Luis
>>
>> El mié, 17 abr 2024 a las 14:33, Holger Knublauch (<
>> hol...@topquadrant.com>) escribió:
>>
>>>
>>>
>>> On 17 Apr 2024, at 2:30 PM, 'Luis Enrique Ramos García' via TopBraid
>>> Suite Users  wrote:
>>>
>>> Thanks for your quick answer,
>>>
>>> But, dear, where should I add this code?.
>>>
>>> Because I tried to add it in the source code panel, and it didn't work,
>>> same with the script panel,
>>> where I expected it should work, but it did not.
>>>
>>> So, I owner in which panel should I add this code?.
>>>
>>> I do not have any idea how to use it.
>>>
>>>
>>> Yes, it requires JS experience. There is no out-of-the-box solution for
>>> what you are trying to express.
>>>
>>> How many enumerations do you need? If it's just a few, I would suggest
>>> going ahead with manual editing of sh:in lists in the Source Code.
>>>
>>> Holger
>>>
>>>
>>>
>>>
>>> Luis
>>>
>>>
>>>
>>> El mié, 17 abr 2024 a las 13:45, Holger Knublauch (<
>>> hol...@topquadrant.com>) escribió:
>>>


 On 17 Apr 2024, at 1:38 PM, 'Luis Enrique Ramos García' via TopBraid
 Suite Users  wrote:

 I am working with version Version: 7.5.1 (20230316-1531).


 Ok then the script may not work, assuming the RDFNodeUtil object was
 introduced later.

 In that case source code editing may be your best solution, unless you
 know how to use this


 createList: (nodes) => {
 let nil = graph.namedNode(rdf.NS + 'nil');
 if(nodes.length == 0) {
 return nil;
 }
 let root = graph.blankNode();
 let current = root;
 

Re: [topbraid-users] enum creation

2024-04-17 Thread David Price
Need the sh:in do be defined in PropertyShaps, not NodeShape.

Example from eariler:

example_schema:ThingWithStatus-hasStatus
  a sh:PropertyShape ;
  sh:path example_schema:hasStatus ;
  sh:class example_schema:Status ;
  sh:description "only Active or Retired allowed" ;
  sh:in (
  example_schema:Active
  example_schema:Retired
) ;
  sh:maxCount 1 ;
  sh:name "has status" ;
.

Cheers,
David

> On 17 Apr 2024, at 14:00, 'Luis Enrique Ramos García' via TopBraid Suite 
> Users  wrote:
> 
> sure, 
> 
> I created a similar ontology for testing with same results, here is the code:
> 
> tesontologyramosenum:Color
>   a owl:Class ;
>   a sh:NodeShape ;
>   rdfs:label "Color" ;
>   rdfs:subClassOf owl:Thing ;
>   sh:in (
>   tesontologyramosenum:Green
>   tesontologyramosenum:Yellow
>   tesontologyramosenum:Red
> ) ;
>   sh:property tesontologyramosenum:Color-label ;
> .
> 
> the screen shot is this:
> 
> 
> 
> 
> with similar results, a datatype property without labeling, and a group of 
> undeclared properties.
> 
> Is this the expected result?
> 
> How do I use this in traffic light instances, if that were the case?
> 
> 
> Luis 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> El mié, 17 abr 2024 a las 14:41, Holger Knublauch ( >) escribió:
>> Can you paste us the complete content of the source code panel, e.g. as a 
>> screenshot? It's hard to see otherwise and there are syntax errors below.
>> 
>> Holger
>> 
>> 
>>> On 17 Apr 2024, at 2:38 PM, 'Luis Enrique Ramos García' via TopBraid Suite 
>>> Users >> > wrote:
>>> 
>>> I need only 3 elements in the enum, 
>>> 
>>> But, I tried at the first the source code edition, and told you the result 
>>> I got:
>>> 
>>> **
>>> 
>>> 1. I tried to add the code by myself, but it seems there is something wrong 
>>> with the code:
>>> sh:in (
>>>   myontology:value1
>>>myontology _:value2
>>>   myontology :value3
>>> ) ;
>>> myontology:property1;
>>> myontology:property2;
>>> myontology:enumproperty;
>>> 
>>> Please, take in account that I edited the enum property just after the 
>>> sh:in, but the editor put it at the end
>>> of the list of properties.
>>> 
>>> Part of the result was this black datatype property in properties list
>>> 
>>> 
>>> 
>>> and in the undeclared property there is a list with these values:
>>> 
>>> in  [myontology:property1;
>>>   myontology:property1;
>>>   myontology:enumproperty;]
>>> 
>>> is thát the expected result?
>>> 
>>> **
>>> 
>>> 
>>> Luis 
>>> 
>>> El mié, 17 abr 2024 a las 14:33, Holger Knublauch (>> >) escribió:
 
 
> On 17 Apr 2024, at 2:30 PM, 'Luis Enrique Ramos García' via TopBraid 
> Suite Users  > wrote:
> 
> Thanks for your quick answer, 
> 
> But, dear, where should I add this code?.
> 
> Because I tried to add it in the source code panel, and it didn't work, 
> same with the script panel,
> where I expected it should work, but it did not. 
> 
> So, I owner in which panel should I add this code?.
> 
> I do not have any idea how to use it.
 
 Yes, it requires JS experience. There is no out-of-the-box solution for 
 what you are trying to express.
 
 How many enumerations do you need? If it's just a few, I would suggest 
 going ahead with manual editing of sh:in lists in the Source Code.
 
 Holger
 
 
> 
> 
> Luis 
> 
> 
> 
> El mié, 17 abr 2024 a las 13:45, Holger Knublauch 
> (mailto:hol...@topquadrant.com>>) escribió:
>> 
>> 
>>> On 17 Apr 2024, at 1:38 PM, 'Luis Enrique Ramos García' via TopBraid 
>>> Suite Users >> > wrote:
>>> 
>>> I am working with version Version: 7.5.1 (20230316-1531).
>> 
>> Ok then the script may not work, assuming the RDFNodeUtil object was 
>> introduced later.
>> 
>> In that case source code editing may be your best solution, unless you 
>> know how to use this
>> 
>> 
>> createList: (nodes) => {
>> let nil = graph.namedNode(rdf.NS + 'nil');
>> if(nodes.length == 0) {
>> return nil;
>> }
>> let root = graph.blankNode();
>> let current = root;
>> nodes.forEach((node, index) => {
>> current.add(rdf.first, node);
>> let rest = index < nodes.length - 1 ? graph.blankNode() : 
>> nil;
>> 

Re: [topbraid-users] enum creation

2024-04-17 Thread Holger Knublauch
Can you paste us the complete content of the source code panel, e.g. as a 
screenshot? It's hard to see otherwise and there are syntax errors below.

Holger


> On 17 Apr 2024, at 2:38 PM, 'Luis Enrique Ramos García' via TopBraid Suite 
> Users  wrote:
> 
> I need only 3 elements in the enum,
> 
> But, I tried at the first the source code edition, and told you the result I 
> got:
> 
> **
> 
> 1. I tried to add the code by myself, but it seems there is something wrong 
> with the code:
> sh:in (
>   myontology:value1
>myontology _:value2
>   myontology :value3
> ) ;
> myontology:property1;
> myontology:property2;
> myontology:enumproperty;
> 
> Please, take in account that I edited the enum property just after the sh:in, 
> but the editor put it at the end
> of the list of properties.
> 
> Part of the result was this black datatype property in properties list
> 
> 
> 
> and in the undeclared property there is a list with these values:
> 
> in  [myontology:property1;
>   myontology:property1;
>   myontology:enumproperty;]
> 
> is thát the expected result?
> 
> **
> 
> 
> Luis
> 
> El mié, 17 abr 2024 a las 14:33, Holger Knublauch ( >) escribió:
>> 
>> 
>>> On 17 Apr 2024, at 2:30 PM, 'Luis Enrique Ramos García' via TopBraid Suite 
>>> Users >> > wrote:
>>> 
>>> Thanks for your quick answer,
>>> 
>>> But, dear, where should I add this code?.
>>> 
>>> Because I tried to add it in the source code panel, and it didn't work, 
>>> same with the script panel,
>>> where I expected it should work, but it did not.
>>> 
>>> So, I owner in which panel should I add this code?.
>>> 
>>> I do not have any idea how to use it.
>> 
>> Yes, it requires JS experience. There is no out-of-the-box solution for what 
>> you are trying to express.
>> 
>> How many enumerations do you need? If it's just a few, I would suggest going 
>> ahead with manual editing of sh:in lists in the Source Code.
>> 
>> Holger
>> 
>> 
>>> 
>>> 
>>> Luis
>>> 
>>> 
>>> 
>>> El mié, 17 abr 2024 a las 13:45, Holger Knublauch (>> >) escribió:
 
 
> On 17 Apr 2024, at 1:38 PM, 'Luis Enrique Ramos García' via TopBraid 
> Suite Users  > wrote:
> 
> I am working with version Version: 7.5.1 (20230316-1531).
 
 Ok then the script may not work, assuming the RDFNodeUtil object was 
 introduced later.
 
 In that case source code editing may be your best solution, unless you 
 know how to use this
 
 
 createList: (nodes) => {
 let nil = graph.namedNode(rdf.NS + 'nil');
 if(nodes.length == 0) {
 return nil;
 }
 let root = graph.blankNode();
 let current = root;
 nodes.forEach((node, index) => {
 current.add(rdf.first, node);
 let rest = index < nodes.length - 1 ? graph.blankNode() : nil;
 current.add(rdf.rest, rest);
 current = rest;
 })
 return root;
 },
 
 
> 
> I included an script panel, refreshed it, and I have this view:
> 
> When I run the script I can see my class, the one for which I want to 
> create the enum, is the result of focusNode.
> 
> But, when I click in "Declare enumerations from instances" I get the same 
> result again:
> 
> 
> I have a question:
> 
> how does my script know from which class I do want to get my instances 
> for the enum list?.
 
 The infrastructure around the ModifyAction will make sure that the 
 variable focusNode points at the asset that
 the action was called from (in the Modify menu).
 
 
> 
> Because I think you are using the same class color?, how do I relate the 
> class traffic light there?
> 
> What I want to say is something like this:
> 
> Product hasSize oneof  Size (short, medium, large)
> 
> And at this moment my focus is in Product, not in Size.
 
 In SHACL you can either add sh:in to a class/node shape or to a property 
 shape. If you just want to add it to a specific property then a different 
 script would be needed.
 
 Holger
 
 
> 
> 
> Luis
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> El mié, 17 abr 2024 a las 11:50, Holger Knublauch 
> (mailto:hol...@topquadrant.com>>) escribió:
>> 
>> 
>>> On 17 Apr 2024, at 11:29 AM, 'Luis Enrique 

Re: [topbraid-users] enum creation

2024-04-17 Thread 'Luis Enrique Ramos García' via TopBraid Suite Users
I need only 3 elements in the enum,

But, I tried at the first the source code edition, and told you the result
I got:

**

1. I tried to add the code by myself, but it seems there is something wrong
with the code:
sh:in (
  myontology:value1
   myontology _:value2
  myontology :value3
) ;
myontology:property1;
myontology:property2;
myontology:enumproperty;

Please, take in account that I edited the enum property just after the
sh:in, but the editor put it at the end
of the list of properties.

Part of the result was this black datatype property in properties list

[image: image.png]

and in the undeclared property there is a list with these values:

in  [myontology:property1;
  myontology:property1;
  myontology:enumproperty;]

is thát the expected result?

**


Luis

El mié, 17 abr 2024 a las 14:33, Holger Knublauch ()
escribió:

>
>
> On 17 Apr 2024, at 2:30 PM, 'Luis Enrique Ramos García' via TopBraid Suite
> Users  wrote:
>
> Thanks for your quick answer,
>
> But, dear, where should I add this code?.
>
> Because I tried to add it in the source code panel, and it didn't work,
> same with the script panel,
> where I expected it should work, but it did not.
>
> So, I owner in which panel should I add this code?.
>
> I do not have any idea how to use it.
>
>
> Yes, it requires JS experience. There is no out-of-the-box solution for
> what you are trying to express.
>
> How many enumerations do you need? If it's just a few, I would suggest
> going ahead with manual editing of sh:in lists in the Source Code.
>
> Holger
>
>
>
>
> Luis
>
>
>
> El mié, 17 abr 2024 a las 13:45, Holger Knublauch ()
> escribió:
>
>>
>>
>> On 17 Apr 2024, at 1:38 PM, 'Luis Enrique Ramos García' via TopBraid
>> Suite Users  wrote:
>>
>> I am working with version Version: 7.5.1 (20230316-1531).
>>
>>
>> Ok then the script may not work, assuming the RDFNodeUtil object was
>> introduced later.
>>
>> In that case source code editing may be your best solution, unless you
>> know how to use this
>>
>>
>> createList: (nodes) => {
>> let nil = graph.namedNode(rdf.NS + 'nil');
>> if(nodes.length == 0) {
>> return nil;
>> }
>> let root = graph.blankNode();
>> let current = root;
>> nodes.forEach((node, index) => {
>> current.add(rdf.first, node);
>> let rest = index < nodes.length - 1 ? graph.blankNode() : nil;
>> current.add(rdf.rest, rest);
>> current = rest;
>> })
>> return root;
>> },
>>
>>
>>
>> I included an script panel, refreshed it, and I have this view:
>> 
>> When I run the script I can see my class, the one for which I want to
>> create the enum, is the result of focusNode.
>>
>> But, when I click in "Declare enumerations from instances" I get the same
>> result again:
>>
>> 
>> I have a question:
>>
>> how does my script know from which class I do want to get my instances
>> for the enum list?.
>>
>>
>> The infrastructure around the ModifyAction will make sure that the
>> variable focusNode points at the asset that
>> the action was called from (in the Modify menu).
>>
>>
>>
>> Because I think you are using the same class color?, how do I relate the
>> class traffic light there?
>>
>> What I want to say is something like this:
>>
>> Product hasSize oneof  Size (short, medium, large)
>>
>> And at this moment my focus is in *Product*, not in *Size*.
>>
>>
>> In SHACL you can either add sh:in to a class/node shape or to a property
>> shape. If you just want to add it to a specific property then a different
>> script would be needed.
>>
>> Holger
>>
>>
>>
>>
>> Luis
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> El mié, 17 abr 2024 a las 11:50, Holger Knublauch (<
>> hol...@topquadrant.com>) escribió:
>>
>>>
>>>
>>> On 17 Apr 2024, at 11:29 AM, 'Luis Enrique Ramos García' via TopBraid
>>> Suite Users  wrote:
>>>
>>> I added the code at the end of the code of the target class, and got
>>> this result:
>>>
>>> 
>>> When I click in "Declare enumeration from instances, I get this view:
>>>
>>> 
>>>
>>>
>>> This looks unexpected. What version are you on? The RDFNodeUtil object
>>> should be there. Maybe try the Refresh button in the Script Editor panel.
>>>
>>>
>>> 
>>> Then, I wonder how to make the system know where my list of enum values
>>> are?
>>>
>>>
>>> It will simply look at the already-existing instances of the currently
>>> selected class, see graph.every(focusNode) where focusNode is the current
>>> class.
>>>
>>> Holger
>>>
>>>
>>>
>>>
>>>
>>> Luis
>>>
>>>
>>>
>>> El mié, 17 abr 2024 a las 10:51, Luis Enrique Ramos García (<
>>> luisenriqueramos1...@googlemail.com>) escribió:
>>>
 Hi Holger,
 Thanks for your answer, but to be frank I find these procedures very
 

Re: [topbraid-users] enum creation

2024-04-17 Thread Holger Knublauch


> On 17 Apr 2024, at 2:30 PM, 'Luis Enrique Ramos García' via TopBraid Suite 
> Users  wrote:
> 
> Thanks for your quick answer,
> 
> But, dear, where should I add this code?.
> 
> Because I tried to add it in the source code panel, and it didn't work, same 
> with the script panel,
> where I expected it should work, but it did not.
> 
> So, I owner in which panel should I add this code?.
> 
> I do not have any idea how to use it.

Yes, it requires JS experience. There is no out-of-the-box solution for what 
you are trying to express.

How many enumerations do you need? If it's just a few, I would suggest going 
ahead with manual editing of sh:in lists in the Source Code.

Holger


> 
> 
> Luis
> 
> 
> 
> El mié, 17 abr 2024 a las 13:45, Holger Knublauch ( >) escribió:
>> 
>> 
>>> On 17 Apr 2024, at 1:38 PM, 'Luis Enrique Ramos García' via TopBraid Suite 
>>> Users >> > wrote:
>>> 
>>> I am working with version Version: 7.5.1 (20230316-1531).
>> 
>> Ok then the script may not work, assuming the RDFNodeUtil object was 
>> introduced later.
>> 
>> In that case source code editing may be your best solution, unless you know 
>> how to use this
>> 
>> 
>> createList: (nodes) => {
>> let nil = graph.namedNode(rdf.NS + 'nil');
>> if(nodes.length == 0) {
>> return nil;
>> }
>> let root = graph.blankNode();
>> let current = root;
>> nodes.forEach((node, index) => {
>> current.add(rdf.first, node);
>> let rest = index < nodes.length - 1 ? graph.blankNode() : nil;
>> current.add(rdf.rest, rest);
>> current = rest;
>> })
>> return root;
>> },
>> 
>> 
>>> 
>>> I included an script panel, refreshed it, and I have this view:
>>> 
>>> When I run the script I can see my class, the one for which I want to 
>>> create the enum, is the result of focusNode.
>>> 
>>> But, when I click in "Declare enumerations from instances" I get the same 
>>> result again:
>>> 
>>> 
>>> I have a question:
>>> 
>>> how does my script know from which class I do want to get my instances for 
>>> the enum list?.
>> 
>> The infrastructure around the ModifyAction will make sure that the variable 
>> focusNode points at the asset that
>> the action was called from (in the Modify menu).
>> 
>> 
>>> 
>>> Because I think you are using the same class color?, how do I relate the 
>>> class traffic light there?
>>> 
>>> What I want to say is something like this:
>>> 
>>> Product hasSize oneof  Size (short, medium, large)
>>> 
>>> And at this moment my focus is in Product, not in Size.
>> 
>> In SHACL you can either add sh:in to a class/node shape or to a property 
>> shape. If you just want to add it to a specific property then a different 
>> script would be needed.
>> 
>> Holger
>> 
>> 
>>> 
>>> 
>>> Luis
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> El mié, 17 abr 2024 a las 11:50, Holger Knublauch (>> >) escribió:
 
 
> On 17 Apr 2024, at 11:29 AM, 'Luis Enrique Ramos García' via TopBraid 
> Suite Users  > wrote:
> 
> I added the code at the end of the code of the target class, and got this 
> result:
> 
> 
> When I click in "Declare enumeration from instances, I get this view:
> 
> 
 
 This looks unexpected. What version are you on? The RDFNodeUtil object 
 should be there. Maybe try the Refresh button in the Script Editor panel.
 
> 
> 
> Then, I wonder how to make the system know where my list of enum values 
> are?
 
 It will simply look at the already-existing instances of the currently 
 selected class, see graph.every(focusNode) where focusNode is the current 
 class.
 
 Holger
 
 
 
> 
> 
> Luis 
> 
> 
> 
> El mié, 17 abr 2024 a las 10:51, Luis Enrique Ramos García 
> ( >) escribió:
>> Hi Holger, 
>> Thanks for your answer, but to be frank I find these procedures very 
>> complicated. 
>> In my opinion the enum is a very common pattern, and I understand when 
>> to use it. 
>> 
>> Anyway, let's try to solve the issue
>> 
>> 1. I tried to add the code by myself, but it seems there is something 
>> wrong with the code:
>> sh:in (
>>   myontology:value1
>>myontology _:value2
>>   myontology :value3
>> ) ;
>> myontology:property1;
>> myontology:property2;
>> myontology:enumproperty;
>> 
>> Please, take in account that I edited the enum property just after the 
>> sh:in, but the editor put it at the end
>> of the list of properties.
>> 
>> Part of the result was this black datatype property in properties list
>> 
>> 
>> 
>> and 

Re: [topbraid-users] enum creation

2024-04-17 Thread 'Luis Enrique Ramos García' via TopBraid Suite Users
Thanks for your quick answer,

But, dear, where should I add this code?.

Because I tried to add it in the source code panel, and it didn't work,
same with the script panel,
where I expected it should work, but it did not.

So, I owner in which panel should I add this code?.

I do not have any idea how to use it.


Luis



El mié, 17 abr 2024 a las 13:45, Holger Knublauch ()
escribió:

>
>
> On 17 Apr 2024, at 1:38 PM, 'Luis Enrique Ramos García' via TopBraid Suite
> Users  wrote:
>
> I am working with version Version: 7.5.1 (20230316-1531).
>
>
> Ok then the script may not work, assuming the RDFNodeUtil object was
> introduced later.
>
> In that case source code editing may be your best solution, unless you
> know how to use this
>
>
> createList: (nodes) => {
> let nil = graph.namedNode(rdf.NS + 'nil');
> if(nodes.length == 0) {
> return nil;
> }
> let root = graph.blankNode();
> let current = root;
> nodes.forEach((node, index) => {
> current.add(rdf.first, node);
> let rest = index < nodes.length - 1 ? graph.blankNode() : nil;
> current.add(rdf.rest, rest);
> current = rest;
> })
> return root;
> },
>
>
>
> I included an script panel, refreshed it, and I have this view:
> 
> When I run the script I can see my class, the one for which I want to
> create the enum, is the result of focusNode.
>
> But, when I click in "Declare enumerations from instances" I get the same
> result again:
>
> 
> I have a question:
>
> how does my script know from which class I do want to get my instances for
> the enum list?.
>
>
> The infrastructure around the ModifyAction will make sure that the
> variable focusNode points at the asset that
> the action was called from (in the Modify menu).
>
>
>
> Because I think you are using the same class color?, how do I relate the
> class traffic light there?
>
> What I want to say is something like this:
>
> Product hasSize oneof  Size (short, medium, large)
>
> And at this moment my focus is in *Product*, not in *Size*.
>
>
> In SHACL you can either add sh:in to a class/node shape or to a property
> shape. If you just want to add it to a specific property then a different
> script would be needed.
>
> Holger
>
>
>
>
> Luis
>
>
>
>
>
>
>
>
>
>
>
>
>
> El mié, 17 abr 2024 a las 11:50, Holger Knublauch ()
> escribió:
>
>>
>>
>> On 17 Apr 2024, at 11:29 AM, 'Luis Enrique Ramos García' via TopBraid
>> Suite Users  wrote:
>>
>> I added the code at the end of the code of the target class, and got this
>> result:
>>
>> 
>> When I click in "Declare enumeration from instances, I get this view:
>>
>> 
>>
>>
>> This looks unexpected. What version are you on? The RDFNodeUtil object
>> should be there. Maybe try the Refresh button in the Script Editor panel.
>>
>>
>> 
>> Then, I wonder how to make the system know where my list of enum values
>> are?
>>
>>
>> It will simply look at the already-existing instances of the currently
>> selected class, see graph.every(focusNode) where focusNode is the current
>> class.
>>
>> Holger
>>
>>
>>
>>
>>
>> Luis
>>
>>
>>
>> El mié, 17 abr 2024 a las 10:51, Luis Enrique Ramos García (<
>> luisenriqueramos1...@googlemail.com>) escribió:
>>
>>> Hi Holger,
>>> Thanks for your answer, but to be frank I find these procedures very
>>> complicated.
>>> In my opinion the enum is a very common pattern, and I understand when
>>> to use it.
>>>
>>> Anyway, let's try to solve the issue
>>>
>>> 1. I tried to add the code by myself, but it seems there is something
>>> wrong with the code:
>>> sh:in (
>>>   myontology:value1
>>>myontology _:value2
>>>   myontology :value3
>>> ) ;
>>> myontology:property1;
>>> myontology:property2;
>>> myontology:enumproperty;
>>>
>>> Please, take in account that I edited the enum property just after the
>>> sh:in, but the editor put it at the end
>>> of the list of properties.
>>>
>>> Part of the result was this black datatype property in properties list
>>>
>>> 
>>>
>>> and in the undeclared property there is a list with these values:
>>>
>>> in  [myontology:property1;
>>>   myontology:property1;
>>>   myontology:enumproperty;]
>>>
>>> is thát the expected result?
>>>
>>> if not, for the second option,
>>>
>>> where do I have to insert this code:
>>>
>>> focusNode.add(sh.in, RDFNodeUtil.createList(graph.every(focusNode)))
>>>
>>>
>>> do I have to add this code at the beginning of the code of my ontology?
>>>
>>>
>>> myontology:ClassActionsGroup
>>> a dash:ActionGroup ;
>>> rdfs:label "Class actions group" ;
>>> .
>>> myontology:DeclareEnumerationFromInstances
>>> a dash:ModifyAction ;
>>> dash:actionGroup myontology:ClassActionsGroup ;
>>> dash:js "focusNode.add(sh.in,
>>> RDFNodeUtil.createList(graph.every(focusNode)))" ;
>>> rdfs:comment "Adds a sh:in declaration that enumerates all (current)
>>> instances of the selected class." ;
>>> rdfs:label "Declare enumeration from instances" ;
>>> .
>>> 

Re: [topbraid-users] enum creation

2024-04-17 Thread Holger Knublauch


> On 17 Apr 2024, at 1:38 PM, 'Luis Enrique Ramos García' via TopBraid Suite 
> Users  wrote:
> 
> I am working with version Version: 7.5.1 (20230316-1531).

Ok then the script may not work, assuming the RDFNodeUtil object was introduced 
later.

In that case source code editing may be your best solution, unless you know how 
to use this


createList: (nodes) => {
let nil = graph.namedNode(rdf.NS + 'nil');
if(nodes.length == 0) {
return nil;
}
let root = graph.blankNode();
let current = root;
nodes.forEach((node, index) => {
current.add(rdf.first, node);
let rest = index < nodes.length - 1 ? graph.blankNode() : nil;
current.add(rdf.rest, rest);
current = rest;
})
return root;
},


> 
> I included an script panel, refreshed it, and I have this view:
> 
> When I run the script I can see my class, the one for which I want to create 
> the enum, is the result of focusNode.
> 
> But, when I click in "Declare enumerations from instances" I get the same 
> result again:
> 
> 
> I have a question:
> 
> how does my script know from which class I do want to get my instances for 
> the enum list?.

The infrastructure around the ModifyAction will make sure that the variable 
focusNode points at the asset that
the action was called from (in the Modify menu).


> 
> Because I think you are using the same class color?, how do I relate the 
> class traffic light there?
> 
> What I want to say is something like this:
> 
> Product hasSize oneof  Size (short, medium, large)
> 
> And at this moment my focus is in Product, not in Size.

In SHACL you can either add sh:in to a class/node shape or to a property shape. 
If you just want to add it to a specific property then a different script would 
be needed.

Holger


> 
> 
> Luis
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> El mié, 17 abr 2024 a las 11:50, Holger Knublauch ( >) escribió:
>> 
>> 
>>> On 17 Apr 2024, at 11:29 AM, 'Luis Enrique Ramos García' via TopBraid Suite 
>>> Users >> > wrote:
>>> 
>>> I added the code at the end of the code of the target class, and got this 
>>> result:
>>> 
>>> 
>>> When I click in "Declare enumeration from instances, I get this view:
>>> 
>>> 
>> 
>> This looks unexpected. What version are you on? The RDFNodeUtil object 
>> should be there. Maybe try the Refresh button in the Script Editor panel.
>> 
>>> 
>>> 
>>> Then, I wonder how to make the system know where my list of enum values are?
>> 
>> It will simply look at the already-existing instances of the currently 
>> selected class, see graph.every(focusNode) where focusNode is the current 
>> class.
>> 
>> Holger
>> 
>> 
>> 
>>> 
>>> 
>>> Luis 
>>> 
>>> 
>>> 
>>> El mié, 17 abr 2024 a las 10:51, Luis Enrique Ramos García 
>>> (>> >) escribió:
 Hi Holger, 
 Thanks for your answer, but to be frank I find these procedures very 
 complicated. 
 In my opinion the enum is a very common pattern, and I understand when to 
 use it. 
 
 Anyway, let's try to solve the issue
 
 1. I tried to add the code by myself, but it seems there is something 
 wrong with the code:
 sh:in (
   myontology:value1
myontology _:value2
   myontology :value3
 ) ;
 myontology:property1;
 myontology:property2;
 myontology:enumproperty;
 
 Please, take in account that I edited the enum property just after the 
 sh:in, but the editor put it at the end
 of the list of properties.
 
 Part of the result was this black datatype property in properties list
 
 
 
 and in the undeclared property there is a list with these values:
 
 in  [myontology:property1;
   myontology:property1;
   myontology:enumproperty;]
 
 is thát the expected result?
 
 if not, for the second option,
 
 where do I have to insert this code:
 
 focusNode.add(sh.in, RDFNodeUtil.createList(graph.every(focusNode)))
 
 
 do I have to add this code at the beginning of the code of my ontology?
 
 
 myontology:ClassActionsGroup
   a dash:ActionGroup ;
   rdfs:label "Class actions group" ;
 .
 myontology:DeclareEnumerationFromInstances
   a dash:ModifyAction ;
   dash:actionGroup myontology:ClassActionsGroup ;
   dash:js "focusNode.add(sh.in , 
 RDFNodeUtil.createList(graph.every(focusNode)))" ;
   rdfs:comment "Adds a sh:in declaration that enumerates all (current) 
 instances of the selected class." ;
   rdfs:label "Declare enumeration from instances" ;
 .
 rdfs:Class
   dash:resourceAction 

Re: [topbraid-users] enum creation

2024-04-17 Thread 'Luis Enrique Ramos García' via TopBraid Suite Users
I am working with version Version: 7.5.1 (20230316-1531).

I included an script panel, refreshed it, and I have this view:
[image: image.png]
When I run the script I can see my class, the one for which I want to
create the enum, is the result of focusNode.

But, when I click in "Declare enumerations from instances" I get the same
result again:

[image: image.png]
I have a question:

how does my script know from which class I do want to get my instances for
the enum list?.

Because I think you are using the same class color?, how do I relate the
class traffic light there?

What I want to say is something like this:

Product hasSize oneof  Size (short, medium, large)

And at this moment my focus is in *Product*, not in *Size*.


Luis













El mié, 17 abr 2024 a las 11:50, Holger Knublauch ()
escribió:

>
>
> On 17 Apr 2024, at 11:29 AM, 'Luis Enrique Ramos García' via TopBraid
> Suite Users  wrote:
>
> I added the code at the end of the code of the target class, and got this
> result:
>
> 
> When I click in "Declare enumeration from instances, I get this view:
>
> 
>
>
> This looks unexpected. What version are you on? The RDFNodeUtil object
> should be there. Maybe try the Refresh button in the Script Editor panel.
>
>
> 
> Then, I wonder how to make the system know where my list of enum values
> are?
>
>
> It will simply look at the already-existing instances of the currently
> selected class, see graph.every(focusNode) where focusNode is the current
> class.
>
> Holger
>
>
>
>
>
> Luis
>
>
>
> El mié, 17 abr 2024 a las 10:51, Luis Enrique Ramos García (<
> luisenriqueramos1...@googlemail.com>) escribió:
>
>> Hi Holger,
>> Thanks for your answer, but to be frank I find these procedures very
>> complicated.
>> In my opinion the enum is a very common pattern, and I understand when to
>> use it.
>>
>> Anyway, let's try to solve the issue
>>
>> 1. I tried to add the code by myself, but it seems there is something
>> wrong with the code:
>> sh:in (
>>   myontology:value1
>>myontology _:value2
>>   myontology :value3
>> ) ;
>> myontology:property1;
>> myontology:property2;
>> myontology:enumproperty;
>>
>> Please, take in account that I edited the enum property just after the
>> sh:in, but the editor put it at the end
>> of the list of properties.
>>
>> Part of the result was this black datatype property in properties list
>>
>> 
>>
>> and in the undeclared property there is a list with these values:
>>
>> in  [myontology:property1;
>>   myontology:property1;
>>   myontology:enumproperty;]
>>
>> is thát the expected result?
>>
>> if not, for the second option,
>>
>> where do I have to insert this code:
>>
>> focusNode.add(sh.in, RDFNodeUtil.createList(graph.every(focusNode)))
>>
>>
>> do I have to add this code at the beginning of the code of my ontology?
>>
>>
>> myontology:ClassActionsGroup
>> a dash:ActionGroup ;
>> rdfs:label "Class actions group" ;
>> .
>> myontology:DeclareEnumerationFromInstances
>> a dash:ModifyAction ;
>> dash:actionGroup myontology:ClassActionsGroup ;
>> dash:js "focusNode.add(sh.in,
>> RDFNodeUtil.createList(graph.every(focusNode)))" ;
>> rdfs:comment "Adds a sh:in declaration that enumerates all (current)
>> instances of the selected class." ;
>> rdfs:label "Declare enumeration from instances" ;
>> .
>> rdfs:Class
>> dash:resourceAction myontology:DeclareEnumerationFromInstances ;
>>
>> I have not done this before, if you have a tutorial or some document I
>> could read, I would really appreciate
>> if you can share it with me.
>>
>>
>>
>>
>> Best regards
>>
>>
>>
>> Luis Ramos
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> El mié, 17 abr 2024 a las 10:00, Holger Knublauch (<
>> hol...@topquadrant.com>) escribió:
>>
>>> Hi Luis,
>>>
>>> declaring an enumerated class is achieved in SHACL via sh:in. There is
>>> no dedicated user interface for creating those quickly, as this isn't
>>> anything that we have seen used much so far. I guess this is because the
>>> user interface for entering instance data is already a drop down box
>>> anyway, typically deemed good enough.
>>>
>>> The main reason for creating enumerations would be to make sure that
>>> ONLY those enumerated values will ever be permitted. For example, the
>>> colors of a traffic light must only be red, green, yellow, but never blue
>>> even if someone adds such an instance later.
>>>
>>> To create those, you have various options. Advanced users would use the
>>> source code panel to enter the sh:in expression. However, similar to what
>>> we had in TBC, I think this can be automated easily. Basically the
>>> following ADS script produces an sh:in enumeration for the selected class:
>>>
>>> focusNode.add(sh.in, RDFNodeUtil.createList(graph.every(focusNode)))
>>>
>>> We can wrap this into a Modify Action (feel free to add the below to
>>> your Ontology or a file that is 

Re: [topbraid-users] enum creation

2024-04-17 Thread Holger Knublauch


> On 17 Apr 2024, at 11:29 AM, 'Luis Enrique Ramos García' via TopBraid Suite 
> Users  wrote:
> 
> I added the code at the end of the code of the target class, and got this 
> result:
> 
> 
> When I click in "Declare enumeration from instances, I get this view:
> 
> 

This looks unexpected. What version are you on? The RDFNodeUtil object should 
be there. Maybe try the Refresh button in the Script Editor panel.

> 
> 
> Then, I wonder how to make the system know where my list of enum values are?

It will simply look at the already-existing instances of the currently selected 
class, see graph.every(focusNode) where focusNode is the current class.

Holger



> 
> 
> Luis 
> 
> 
> 
> El mié, 17 abr 2024 a las 10:51, Luis Enrique Ramos García 
> ( >) escribió:
>> Hi Holger, 
>> Thanks for your answer, but to be frank I find these procedures very 
>> complicated. 
>> In my opinion the enum is a very common pattern, and I understand when to 
>> use it. 
>> 
>> Anyway, let's try to solve the issue
>> 
>> 1. I tried to add the code by myself, but it seems there is something wrong 
>> with the code:
>> sh:in (
>>   myontology:value1
>>myontology _:value2
>>   myontology :value3
>> ) ;
>> myontology:property1;
>> myontology:property2;
>> myontology:enumproperty;
>> 
>> Please, take in account that I edited the enum property just after the 
>> sh:in, but the editor put it at the end
>> of the list of properties.
>> 
>> Part of the result was this black datatype property in properties list
>> 
>> 
>> 
>> and in the undeclared property there is a list with these values:
>> 
>> in  [myontology:property1;
>>   myontology:property1;
>>   myontology:enumproperty;]
>> 
>> is thát the expected result?
>> 
>> if not, for the second option,
>> 
>> where do I have to insert this code:
>> 
>> focusNode.add(sh.in, RDFNodeUtil.createList(graph.every(focusNode)))
>> 
>> 
>> do I have to add this code at the beginning of the code of my ontology?
>> 
>> 
>> myontology:ClassActionsGroup
>>   a dash:ActionGroup ;
>>   rdfs:label "Class actions group" ;
>> .
>> myontology:DeclareEnumerationFromInstances
>>   a dash:ModifyAction ;
>>   dash:actionGroup myontology:ClassActionsGroup ;
>>   dash:js "focusNode.add(sh.in , 
>> RDFNodeUtil.createList(graph.every(focusNode)))" ;
>>   rdfs:comment "Adds a sh:in declaration that enumerates all (current) 
>> instances of the selected class." ;
>>   rdfs:label "Declare enumeration from instances" ;
>> .
>> rdfs:Class
>>   dash:resourceAction myontology:DeclareEnumerationFromInstances ;
>> 
>> I have not done this before, if you have a tutorial or some document I could 
>> read, I would really appreciate 
>> if you can share it with me.
>> 
>> 
>> 
>> 
>> Best regards
>> 
>> 
>> 
>> Luis Ramos
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> El mié, 17 abr 2024 a las 10:00, Holger Knublauch (> >) escribió:
>>> Hi Luis,
>>> 
>>> declaring an enumerated class is achieved in SHACL via sh:in. There is no 
>>> dedicated user interface for creating those quickly, as this isn't anything 
>>> that we have seen used much so far. I guess this is because the user 
>>> interface for entering instance data is already a drop down box anyway, 
>>> typically deemed good enough.
>>> 
>>> The main reason for creating enumerations would be to make sure that ONLY 
>>> those enumerated values will ever be permitted. For example, the colors of 
>>> a traffic light must only be red, green, yellow, but never blue even if 
>>> someone adds such an instance later.
>>> 
>>> To create those, you have various options. Advanced users would use the 
>>> source code panel to enter the sh:in expression. However, similar to what 
>>> we had in TBC, I think this can be automated easily. Basically the 
>>> following ADS script produces an sh:in enumeration for the selected class:
>>> 
>>> focusNode.add(sh.in, RDFNodeUtil.createList(graph.every(focusNode)))
>>> 
>>> We can wrap this into a Modify Action (feel free to add the below to your 
>>> Ontology or a file that is included into your ontology):
>>> 
>>> 
>>> myontology:ClassActionsGroup
>>>   a dash:ActionGroup ;
>>>   rdfs:label "Class actions group" ;
>>> .
>>> myontology:DeclareEnumerationFromInstances
>>>   a dash:ModifyAction ;
>>>   dash:actionGroup myontology:ClassActionsGroup ;
>>>   dash:js "focusNode.add(sh.in , 
>>> RDFNodeUtil.createList(graph.every(focusNode)))" ;
>>>   rdfs:comment "Adds a sh:in declaration that enumerates all (current) 
>>> instances of the selected class." ;
>>>   rdfs:label "Declare enumeration from instances" ;
>>> .
>>> rdfs:Class
>>>   dash:resourceAction myontology:DeclareEnumerationFromInstances ;
>>> .
>>> 
>>> With this in place, you can run it from the Modify menu of any 

Re: [topbraid-users] Asserting inverse properties (skos:topConceptOf)

2024-04-17 Thread David Price


> On 17 Apr 2024, at 09:18, Holger Knublauch  wrote:
> 
> Hi Dan,
> 
> yes this can be achieved through a dash:ChangeScript, see 
> https://archive.topquadrant.com/doc/latest/ext/points.html#change-and-commit-scripts
> 
> Basically, such scripts are triggered after every change and may perform 
> additional changes. In this case, whenever a skos:hasTopConcept gets 
> asserted, it would need to assert the corresponding inverse triple. And the 
> same for deleting triples. To work consistently, it would need to operate in 
> both directions.
> 
> Note that in contrast to ChangeScripts, inference rules such as sh:values 
> rules are only computed on demand and not persisted. They are only computed 
> to populate the user interface, for example when you look at the narrower 
> concepts that render as inverse of skos:broader triples. We only store these 
> in one direction, and do so intentionally because having an inverse triple is 
> just adding extra costs and drive up the maintenance burden as it is easy to 
> get into situations where the two directions become out of synch. Therefore 
> we strongly discourage using explicit inverse triples, instead preferring 
> sh:inversePath declarations.
> 

Holger is 100% right on the “discourage using explicit inverse triples” idea. 
They are nearly impossible to keep synch’d and we have recent customer 
situations where we had to “undo” that mistake as part of a data model V2 and 
related data migration.

> In my personal opinion, introducing inverse properties with OWL was a major 
> mistake, and it got unfortunately propagated into SKOS too. As RDF triples 
> are symmetric between subjects and objects, and graphs can be walked in both 
> directions equally.
> 

>From a modeller’s perspective the main “good” reason to include inverse 
>properties in SHACL it is so that the reverse property can have cardinality 
>constraints. That need does pop up, so almost all data modelling 
>languages/standards support the idea of inverse relations with cardinality. 
>It’s not specific to RDF-land.

Cheers,
David

> Do you have downstream tools that require these explicit inverse triples?
> 
> Holger
> 
> 
>> On 16 Apr 2024, at 8:03 PM, Dan Segal  wrote:
>> 
>> Is there a way to assert an inverse property into the source code of a 
>> concept?
>> 
>> For example, where we have:
>> 
>> conceptScheme skos:hasTopConcept concept
>> 
>> we want to assert:
>> 
>> concept skos:topConceptOf conceptScheme
>> 
>> Since skos:topConceptOf is defined as the inverse of skos:hasTopConcept, the 
>> relationship displays in the form view.   However, we want to assert the 
>> statement so that the triple concept skos:topConceptOf conceptScheme is 
>> written to the RDF.
>> 
>> Have tried a property rule, as well executing inference rules.  Neither 
>> results in the inverse relationship being written to RDF.
>> 
>> Thank you
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> -- 
>> The topics of this mailing list include TopBraid EDG and related 
>> technologies such as SHACL.
>> To post to this group, send email to topbraid-users@googlegroups.com
>> --- 
>> 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/c4724215-481a-4c08-960b-7c29ffb16169n%40googlegroups.com
>>  
>> .
> 
> 
> -- 
> The topics of this mailing list include TopBraid EDG and related technologies 
> such as SHACL.
> To post to this group, send email to topbraid-users@googlegroups.com
> --- 
> 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/67C9D2F5-C581-4F8E-AB40-CEB3A897DCBB%40topquadrant.com
>  
> .

-- 
The topics of this mailing list include TopBraid EDG and related technologies 
such as SHACL.
To post to this group, send email to topbraid-users@googlegroups.com
--- 
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 

Re: [topbraid-users] Asserting inverse properties (skos:topConceptOf)

2024-04-17 Thread Holger Knublauch
Hi Dan,

yes this can be achieved through a dash:ChangeScript, see 
https://archive.topquadrant.com/doc/latest/ext/points.html#change-and-commit-scripts

Basically, such scripts are triggered after every change and may perform 
additional changes. In this case, whenever a skos:hasTopConcept gets asserted, 
it would need to assert the corresponding inverse triple. And the same for 
deleting triples. To work consistently, it would need to operate in both 
directions.

Note that in contrast to ChangeScripts, inference rules such as sh:values rules 
are only computed on demand and not persisted. They are only computed to 
populate the user interface, for example when you look at the narrower concepts 
that render as inverse of skos:broader triples. We only store these in one 
direction, and do so intentionally because having an inverse triple is just 
adding extra costs and drive up the maintenance burden as it is easy to get 
into situations where the two directions become out of synch. Therefore we 
strongly discourage using explicit inverse triples, instead preferring 
sh:inversePath declarations.

In my personal opinion, introducing inverse properties with OWL was a major 
mistake, and it got unfortunately propagated into SKOS too. As RDF triples are 
symmetric between subjects and objects, and graphs can be walked in both 
directions equally.

Do you have downstream tools that require these explicit inverse triples?

Holger


> On 16 Apr 2024, at 8:03 PM, Dan Segal  wrote:
> 
> Is there a way to assert an inverse property into the source code of a 
> concept?
> 
> For example, where we have:
> 
> conceptScheme skos:hasTopConcept concept
> 
> we want to assert:
> 
> concept skos:topConceptOf conceptScheme
> 
> Since skos:topConceptOf is defined as the inverse of skos:hasTopConcept, the 
> relationship displays in the form view.   However, we want to assert the 
> statement so that the triple concept skos:topConceptOf conceptScheme is 
> written to the RDF.
> 
> Have tried a property rule, as well executing inference rules.  Neither 
> results in the inverse relationship being written to RDF.
> 
> Thank you
> 
> 
> 
> 
> 
> 
> 
> -- 
> The topics of this mailing list include TopBraid EDG and related technologies 
> such as SHACL.
> To post to this group, send email to topbraid-users@googlegroups.com
> --- 
> 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/c4724215-481a-4c08-960b-7c29ffb16169n%40googlegroups.com
>  
> .

-- 
The topics of this mailing list include TopBraid EDG and related technologies 
such as SHACL.
To post to this group, send email to topbraid-users@googlegroups.com
--- 
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/67C9D2F5-C581-4F8E-AB40-CEB3A897DCBB%40topquadrant.com.


[topbraid-users] enum creation

2024-04-17 Thread 'Luis Enrique Ramos García' via TopBraid Suite Users
 

I need to model an enum, 

and found this non uptodate tutorial:

https://topbraidcomposer.org/html/Create_an_enumeration.htm

Thus, I wonder if there is an uptodate procedure to create an enum in EDG?

 

Thanks


Luis 

-- 
The topics of this mailing list include TopBraid EDG and related technologies 
such as SHACL.
To post to this group, send email to topbraid-users@googlegroups.com
--- 
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/6621d600-2195-4e9c-9b5d-58ce8172722bn%40googlegroups.com.