[topbraid-users] Formal definition of GraphQL mutations

2024-07-17 Thread Davide Sottara
Hi!
I have been using the out of the box GraphQL mutations, "createX", 
"addToX", "updateX" where X is one of my class/shapes.
I have been observing some behaviors that are not immediately evident from 
the 
documentation here:
https://www.topquadrant.com/doc/7.8/graphql/mutations.html

For example, "createX(uri)" does not violate any constraint if "uri" 
already 
exists as an individual, but reports a violation if uri is an instance of X.
That is, it does not check that "uri ?p ?o", but rather "uri a _ 
subClassOf* X".
This would be consistent with the documentation. 

However, updateX(uri) does *not *seem to check "uri a X" as a precondition. 
In fact, if the mutation is able to assert "uri a Y" through a property 
shape 
bound to rdf:type, the mutation succeeds, effectively creating a new 
individual with a type that may be unrelated to X.
Besides being a way to implement "duck typing", this operation behaves
more like "upsert" than "update" - very useful!, but not exactly what I 
would
expect from the name and the docs.

In general, is there a more precise definition of the mutations - for 
example 
by means of an equivalent SPARQL query ?

Thank you in advance
Davide


-- 
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/3cf38e5a-e1b2-4ed6-afbf-c5665f7e6fe9n%40googlegroups.com.


Re: [topbraid-users] Materialized inferred values in GraphQL queries

2024-02-08 Thread Davide Sottara
Hi Holger
Thank you for confirming our hypothesis

Yes, in general we can materialize the triples, or rewrite the queries.

One use case stands: sometimes we work with structured, encoded data.
This is not the real use case, but along the lines:

subj
  myCodedAttribute: "AA-xyz-1234" 

which can be deconstructed:

subj
  myCategory: "urn:AA"
  mySource: "urn:xyz"
  myIdentifier: "1234"

Keeping these triples inferred allows to save space for large datasets,
especially if we query by one "subj" URI at a time, but then we hit the 
performance penalty if we query the entire dataset by, say, "myCategory".

Other than rewriting the query or the dataset, we can also query by subj,
and then filter by category client-side.
We'd rather not use ad-hoc javascript code except in extreme cases

Davide


On Tuesday, February 6, 2024 at 10:17:49 AM UTC-6 Holger Knublauch wrote:

> Correct, filtering on inferred values is very inefficient, because there 
> is no general "inverse" of sh:values rules.
>
> Best to be avoided by asserting the inferences or querying the asserted 
> triples that are the base of the rules.
>
> What sort of inferences do you need to query? Maybe there is a way to 
> optimize those...
>
> Holger
>
>
> On 6 Feb 2024, at 5:12 pm, Davide Sottara  wrote:
>
> Hi Holger, Michael,
> I have a related question. In the following query:
>
> query myQuery($id : ID, $value: String) {
>myClass(
>   uri: $id
>   inferred: $value
>) {
>  label
>}
> }
>
> if "inferred" is a property with an inference rule, is it possible that 
> the inference 
> is executed for all instances of myClass, before the filtering by $id (and 
> $value)?
> More generally, is there any kind of query planning in the GraphQL engine, 
> and/or how does it integrate with the inference rules?
>
> We can always refactor our queries and/or materialize the triples, but any 
> insight 
> on the engine inner workings would surely help.
>
> Thank you!!
> On Monday, February 5, 2024 at 5:25:33 PM UTC-6 Michael Panzer wrote:
>
>> We have not already done this, but will give it a try.
>>
>> Michael
>>
>> On Monday, February 5, 2024 at 10:49:19 AM UTC-6 Holger Knublauch wrote:
>>
>>> Quite possibly yes. For these properties, the engine will look both for 
>>> asserted and inferred values.
>>>
>>> Have you tried removing the sh:values rules (temporarily) and run the 
>>> same queries, comparing the execution time?
>>> If you assert them anyway, would it make sense for you to have these 
>>> sh:values rules disabled for the runtime system?
>>>
>>> Holger
>>>
>>>
>>> On 5 Feb 2024, at 5:08 pm, Michael Panzer  wrote:
>>>
>>> Hi,
>>>
>>> does anybody know if, given a sh:values rule that is materialized, the 
>>> GraphQL engine still does on-the-fly inferencing of values (even though the 
>>> triples are in the graph)?
>>>
>>> My hunch is that it does. We are seeing very slow performance from 
>>> GraphQL queries and trying to narrow down if this is related to inferred 
>>> values.
>>>
>>> Cheers
>>> Michael
>>>
>>> -- 
>>> The topics of this mailing list include TopBraid EDG and related 
>>> technologies such as SHACL.
>>> To post to this group, send email to topbrai...@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-user...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/topbraid-users/bf448cae-0bfa-4837-ae62-6b949e1b7c1an%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/topbraid-users/bf448cae-0bfa-4837-ae62-6b949e1b7c1an%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>>
>>>
> -- 
> The topics of this mailing list include TopBraid EDG and related 
> technologies such as SHACL.
> To post to this group, send email to topbrai...@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-user...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/869a599d-

Re: [topbraid-users] Materialized inferred values in GraphQL queries

2024-02-06 Thread Davide Sottara
Hi Holger, Michael,
I have a related question. In the following query:

query myQuery($id : ID, $value: String) {
   myClass(
  uri: $id
  inferred: $value
   ) {
 label
   }
}

if "inferred" is a property with an inference rule, is it possible that the 
inference 
is executed for all instances of myClass, before the filtering by $id (and 
$value)?
More generally, is there any kind of query planning in the GraphQL engine, 
and/or how does it integrate with the inference rules?

We can always refactor our queries and/or materialize the triples, but any 
insight 
on the engine inner workings would surely help.

Thank you!!
On Monday, February 5, 2024 at 5:25:33 PM UTC-6 Michael Panzer wrote:

> We have not already done this, but will give it a try.
>
> Michael
>
> On Monday, February 5, 2024 at 10:49:19 AM UTC-6 Holger Knublauch wrote:
>
>> Quite possibly yes. For these properties, the engine will look both for 
>> asserted and inferred values.
>>
>> Have you tried removing the sh:values rules (temporarily) and run the 
>> same queries, comparing the execution time?
>> If you assert them anyway, would it make sense for you to have these 
>> sh:values rules disabled for the runtime system?
>>
>> Holger
>>
>>
>> On 5 Feb 2024, at 5:08 pm, Michael Panzer  wrote:
>>
>> Hi,
>>
>> does anybody know if, given a sh:values rule that is materialized, the 
>> GraphQL engine still does on-the-fly inferencing of values (even though the 
>> triples are in the graph)?
>>
>> My hunch is that it does. We are seeing very slow performance from 
>> GraphQL queries and trying to narrow down if this is related to inferred 
>> values.
>>
>> Cheers
>> Michael
>>
>> -- 
>> The topics of this mailing list include TopBraid EDG and related 
>> technologies such as SHACL.
>> To post to this group, send email to topbrai...@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-user...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/topbraid-users/bf448cae-0bfa-4837-ae62-6b949e1b7c1an%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/869a599d-37ab-418f-96bb-e859f8d45913n%40googlegroups.com.


Re: [topbraid-users] Does EDG support modeling Attributes of Properties?

2023-12-11 Thread Davide Sottara
My bad, yes, rdfs:Class not owl:Class

This said, here is what I can see 
PropertyShape does have the rdfs:Class type asserted in an included graph.

tosh:NodeShape-applicableToClass
  a sh:PropertyShape ;
  sh:path dash:applicableToClass ;
  sh:class rdfs:Class ;
  sh:description "Links a node shape with the classes that it can be 
applied to." ;
  sh:group tosh:TargetsPropertyGroup ;
  sh:name "applicable to classes" ;
  sh:nodeKind sh:IRI ;
  sh:order "10"^^xsd:decimal ;
.
dash:applicableToClass
  a rdf:Property ;
  rdfs:comment "Can be used..(omitted)." ;
  rdfs:domain sh:Shape ;
  rdfs:label "applicable to class" ;
  rdfs:range rdfs:Class ;
.
sh:PropertyShape
  a rdfs:Class ;
  a sh:NodeShape ;
  rdfs:comment "A property shape is a shape that specifies constraints on 
the values of a focus node for a given property or path."@en ;
  rdfs:isDefinedBy sh: ;
  rdfs:label "Property shape"@en ;
  rdfs:subClassOf sh:Shape ;


On Monday, December 11, 2023 at 11:39:37 AM UTC-6 Holger Knublauch wrote:

> Ok thanks, in my copy of tosh this would be rdfs:Class not owl:Class, but 
> it indicates that sh:PropertyShape has no type. This is surprising as it 
> does have type rdfs:Class in the SHACL metamodel itself.
>
> sh:PropertyShape
> a rdfs:Class ;
> rdfs:label "Property shape"@en ;
> rdfs:comment "A property shape is a shape that specifies constraints on 
> the values of a focus node for a given property or path."@en ;
> rdfs:subClassOf sh:Shape ;
> rdfs:isDefinedBy sh: .
>
>
> How does your definition of tosh:NodeShape-applicableToClass look like?
>
> Holger
>
>
> On 11 Dec 2023, at 6:17 pm, Davide Sottara  wrote:
>
> From the "info":
>   Constraint of type ClassConstraintComponent defined at shape 
> tosh:NodeShape-applicableToClass
>
> Davide
>
> On Monday, December 11, 2023 at 11:03:06 AM UTC-6 Holger Knublauch wrote:
>
>>
>> On 11 Dec 2023, at 6:00 pm, Davide Sottara  wrote:
>>
>> Hi Holger, thank your for your quick response.
>>
>> Yes, setting an explicit target works:
>>
>> tosh:ObjectPropertyShapeView
>>   dash:applicableToClass sh:PropertyShape ;
>> .
>>
>> I do get a validation error in the UI, because sh:PropertyShape is not an 
>> owl:Class,
>>
>>
>> which constraint does check for owl:Class? Is this from "our" shapes or 
>> yours?
>>
>> The little i (information) icon on the Problems and Suggestions panel 
>> should have details.
>>
>> Holger
>>
>>
>> but I guess it can be safely ignored?
>>
>> On Monday, December 11, 2023 at 9:38:55 AM UTC-6 Holger Knublauch wrote:
>>
>>> Hi Davide,
>>>
>>> the GraphQL engine needs to know which focus nodes are targeted by these 
>>> shapes. It uses sh:targetClass etc for that.
>>>
>>> tosh:ObjectPropertyShapeView does not have any target. Maybe try adding 
>>> dash:applicableToClass sh:PropertyShape or sh:targetClass?
>>>
>>> Holger
>>>
>>>
>>> On 11 Dec 2023, at 4:24 pm, Davide Sottara  wrote:
>>>
>>> I am trying to query the tosh: shapes via GraphQL. I have exposed them 
>>> as publicShapes, so that they show up in the GraphQL schema
>>>
>>> rdfsowlclassViews { uri } works as expected
>>> objectPropertyShapeViews { uri } returns an empty collection
>>>
>>> Are there any constraints for the ObjectPropertyShapes to be matched by 
>>> the query?
>>> I am targeting the default GraphQL endpoint (not the 'meta', nor the 
>>> 'skos') of a DataGraph, which includes the Ontology where the property 
>>> shapes are defined. 
>>>
>>> I am using EDG 7.6
>>>
>>> Thank you in advance
>>> Davide
>>>
>>> On Thursday, May 11, 2023 at 10:21:44 AM UTC-5 Holger Knublauch wrote:
>>>
>>>> Hi Jennifer,
>>>>
>>>> if I interpret your question correctly, you want to be able to attach 
>>>> additional properties to the definitions of properties themselves?
>>>>
>>>> In TopBraid and SHACL, properties are typically represented using 
>>>> Property Shapes. The list of properties that show up on the forms for 
>>>> property shapes are defined in the dedicated node shapes
>>>>
>>>> - tosh:ObjectPropertyShapeView for relationships
>>>> - tosh:DatatypePropertyShapeView for attributes
>>>>
>>>> You can define your own extensions to those shapes by creating an 
>>>> Ontology and navigating

Re: [topbraid-users] Does EDG support modeling Attributes of Properties?

2023-12-11 Thread Davide Sottara
>From the "info":
  Constraint of type ClassConstraintComponent defined at shape 
tosh:NodeShape-applicableToClass

Davide

On Monday, December 11, 2023 at 11:03:06 AM UTC-6 Holger Knublauch wrote:

>
> On 11 Dec 2023, at 6:00 pm, Davide Sottara  wrote:
>
> Hi Holger, thank your for your quick response.
>
> Yes, setting an explicit target works:
>
> tosh:ObjectPropertyShapeView
>   dash:applicableToClass sh:PropertyShape ;
> .
>
> I do get a validation error in the UI, because sh:PropertyShape is not an 
> owl:Class,
>
>
> which constraint does check for owl:Class? Is this from "our" shapes or 
> yours?
>
> The little i (information) icon on the Problems and Suggestions panel 
> should have details.
>
> Holger
>
>
> but I guess it can be safely ignored?
>
> On Monday, December 11, 2023 at 9:38:55 AM UTC-6 Holger Knublauch wrote:
>
>> Hi Davide,
>>
>> the GraphQL engine needs to know which focus nodes are targeted by these 
>> shapes. It uses sh:targetClass etc for that.
>>
>> tosh:ObjectPropertyShapeView does not have any target. Maybe try adding 
>> dash:applicableToClass sh:PropertyShape or sh:targetClass?
>>
>> Holger
>>
>>
>> On 11 Dec 2023, at 4:24 pm, Davide Sottara  wrote:
>>
>> I am trying to query the tosh: shapes via GraphQL. I have exposed them as 
>> publicShapes, so that they show up in the GraphQL schema
>>
>> rdfsowlclassViews { uri } works as expected
>> objectPropertyShapeViews { uri } returns an empty collection
>>
>> Are there any constraints for the ObjectPropertyShapes to be matched by 
>> the query?
>> I am targeting the default GraphQL endpoint (not the 'meta', nor the 
>> 'skos') of a DataGraph, which includes the Ontology where the property 
>> shapes are defined. 
>>
>> I am using EDG 7.6
>>
>> Thank you in advance
>> Davide
>>
>> On Thursday, May 11, 2023 at 10:21:44 AM UTC-5 Holger Knublauch wrote:
>>
>>> Hi Jennifer,
>>>
>>> if I interpret your question correctly, you want to be able to attach 
>>> additional properties to the definitions of properties themselves?
>>>
>>> In TopBraid and SHACL, properties are typically represented using 
>>> Property Shapes. The list of properties that show up on the forms for 
>>> property shapes are defined in the dedicated node shapes
>>>
>>> - tosh:ObjectPropertyShapeView for relationships
>>> - tosh:DatatypePropertyShapeView for attributes
>>>
>>> You can define your own extensions to those shapes by creating an 
>>> Ontology and navigating to those shapes in the Node Shapes panel. Then add 
>>> the properties that you need to those.
>>>
>>> If this doesn't answer your question, please follow up. Another 
>>> interpretation may be reification, see 
>>> https://datashapes.org/reification.html
>>>
>>> Holger
>>>
>>>
>>>
>>> On 11 May 2023, at 4:15 pm, 'Jennifer Schmich' via TopBraid Suite Users <
>>> topbrai...@googlegroups.com> wrote:
>>>
>>> Does anyone here know (or can point me to documentation if such exists) 
>>> if TopBraid EDG provides any support for attributes of properties? I know 
>>> workarounds for this problem exist in RDF but I’m wondering if TopBraid 
>>> provides any utilities for it or if it’s all manual.
>>>
>>> Thanks!
>>>
>>> -- 
>>> The topics of this mailing list include TopBraid EDG and related 
>>> technologies such as SHACL.
>>> To post to this group, send email to topbrai...@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-user...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/topbraid-users/5c062fca-299b-4ff9-af62-e7512eb8a1e8n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/topbraid-users/5c062fca-299b-4ff9-af62-e7512eb8a1e8n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>>
>>>
>> -- 
>> The topics of this mailing list include TopBraid EDG and related 
>> technologies such as SHACL.
>> To post to this group, send email to topbrai...@googlegroups.com
>> --- 
>> You received this message because you are subscribed to the Google Groups

Re: [topbraid-users] Does EDG support modeling Attributes of Properties?

2023-12-11 Thread Davide Sottara
Hi Holger, thank your for your quick response.

Yes, setting an explicit target works:

tosh:ObjectPropertyShapeView
  dash:applicableToClass sh:PropertyShape ;
.

I do get a validation error in the UI, because sh:PropertyShape is not an 
owl:Class,
but I guess it can be safely ignored?

On Monday, December 11, 2023 at 9:38:55 AM UTC-6 Holger Knublauch wrote:

> Hi Davide,
>
> the GraphQL engine needs to know which focus nodes are targeted by these 
> shapes. It uses sh:targetClass etc for that.
>
> tosh:ObjectPropertyShapeView does not have any target. Maybe try adding 
> dash:applicableToClass sh:PropertyShape or sh:targetClass?
>
> Holger
>
>
> On 11 Dec 2023, at 4:24 pm, Davide Sottara  wrote:
>
> I am trying to query the tosh: shapes via GraphQL. I have exposed them as 
> publicShapes, so that they show up in the GraphQL schema
>
> rdfsowlclassViews { uri } works as expected
> objectPropertyShapeViews { uri } returns an empty collection
>
> Are there any constraints for the ObjectPropertyShapes to be matched by 
> the query?
> I am targeting the default GraphQL endpoint (not the 'meta', nor the 
> 'skos') of a DataGraph, which includes the Ontology where the property 
> shapes are defined. 
>
> I am using EDG 7.6
>
> Thank you in advance
> Davide
>
> On Thursday, May 11, 2023 at 10:21:44 AM UTC-5 Holger Knublauch wrote:
>
>> Hi Jennifer,
>>
>> if I interpret your question correctly, you want to be able to attach 
>> additional properties to the definitions of properties themselves?
>>
>> In TopBraid and SHACL, properties are typically represented using 
>> Property Shapes. The list of properties that show up on the forms for 
>> property shapes are defined in the dedicated node shapes
>>
>> - tosh:ObjectPropertyShapeView for relationships
>> - tosh:DatatypePropertyShapeView for attributes
>>
>> You can define your own extensions to those shapes by creating an 
>> Ontology and navigating to those shapes in the Node Shapes panel. Then add 
>> the properties that you need to those.
>>
>> If this doesn't answer your question, please follow up. Another 
>> interpretation may be reification, see 
>> https://datashapes.org/reification.html
>>
>> Holger
>>
>>
>>
>> On 11 May 2023, at 4:15 pm, 'Jennifer Schmich' via TopBraid Suite Users <
>> topbrai...@googlegroups.com> wrote:
>>
>> Does anyone here know (or can point me to documentation if such exists) 
>> if TopBraid EDG provides any support for attributes of properties? I know 
>> workarounds for this problem exist in RDF but I’m wondering if TopBraid 
>> provides any utilities for it or if it’s all manual.
>>
>> Thanks!
>>
>> -- 
>> The topics of this mailing list include TopBraid EDG and related 
>> technologies such as SHACL.
>> To post to this group, send email to topbrai...@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-user...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/topbraid-users/5c062fca-299b-4ff9-af62-e7512eb8a1e8n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/topbraid-users/5c062fca-299b-4ff9-af62-e7512eb8a1e8n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>>
>>
> -- 
> The topics of this mailing list include TopBraid EDG and related 
> technologies such as SHACL.
> To post to this group, send email to topbrai...@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-user...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/190ce71d-1da2-4be2-bad1-ff30fd6c8263n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/190ce71d-1da2-4be2-bad1-ff30fd6c8263n%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
>

-- 
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/3e2fb3dd-05f3-4511-8dce-9bb0484913dbn%40googlegroups.com.


Re: [topbraid-users] Does EDG support modeling Attributes of Properties?

2023-12-11 Thread Davide Sottara
I am trying to query the tosh: shapes via GraphQL. I have exposed them as 
publicShapes, so that they show up in the GraphQL schema

rdfsowlclassViews { uri } works as expected
objectPropertyShapeViews { uri } returns an empty collection

Are there any constraints for the ObjectPropertyShapes to be matched by the 
query?
I am targeting the default GraphQL endpoint (not the 'meta', nor the 
'skos') of a DataGraph, which includes the Ontology where the property 
shapes are defined. 

I am using EDG 7.6

Thank you in advance
Davide

On Thursday, May 11, 2023 at 10:21:44 AM UTC-5 Holger Knublauch wrote:

> Hi Jennifer,
>
> if I interpret your question correctly, you want to be able to attach 
> additional properties to the definitions of properties themselves?
>
> In TopBraid and SHACL, properties are typically represented using Property 
> Shapes. The list of properties that show up on the forms for property 
> shapes are defined in the dedicated node shapes
>
> - tosh:ObjectPropertyShapeView for relationships
> - tosh:DatatypePropertyShapeView for attributes
>
> You can define your own extensions to those shapes by creating an Ontology 
> and navigating to those shapes in the Node Shapes panel. Then add the 
> properties that you need to those.
>
> If this doesn't answer your question, please follow up. Another 
> interpretation may be reification, see 
> https://datashapes.org/reification.html
>
> Holger
>
>
>
> On 11 May 2023, at 4:15 pm, 'Jennifer Schmich' via TopBraid Suite Users <
> topbrai...@googlegroups.com> wrote:
>
> Does anyone here know (or can point me to documentation if such exists) if 
> TopBraid EDG provides any support for attributes of properties? I know 
> workarounds for this problem exist in RDF but I’m wondering if TopBraid 
> provides any utilities for it or if it’s all manual.
>
> Thanks!
>
> -- 
> The topics of this mailing list include TopBraid EDG and related 
> technologies such as SHACL.
> To post to this group, send email to topbrai...@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-user...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/5c062fca-299b-4ff9-af62-e7512eb8a1e8n%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/190ce71d-1da2-4be2-bad1-ff30fd6c8263n%40googlegroups.com.


Re: [topbraid-users] GraphQL ...on SubClass/SubShape

2023-11-28 Thread Davide Sottara
This is quite interesting, thank you!

1) Yes - but combined with other workarounds, such as pushing the property 
shapes up the hierarchy, or querying multiple subclasses in parallel, 
provides options
2) Yes - it changes the structure with respect to a common interface/union 
class, which we don't have anyway (!)

Davide

Out of curiosity: if there was a way for users to declare unions or 
interfaces via a triple in the graphql: namespace, so that the 
union/interface declaration could be 
added to the GraphQL schema, would the GraphQL engine in EDG work out of 
the box?

On Tuesday, November 28, 2023 at 1:07:33 PM UTC-6 Holger Knublauch wrote:

> One more thought: it seems like you want to dynamically cast from one type 
> to another. You can theoretically do that through a virtual property that 
> points at the instance itself but with a different declared sh:class. Add 
> these triples to your ontology;
>
> hst:AAA
> sh:property hst:AAA-asBBB .
>
> hst:AAA-asBBB
>   a sh:PropertyShape ;
>   sh:path hst:asBBB ;
>   dash:hidden true ;
>   sh:class hst:BBB ;
>   sh:maxCount 1 ;
>   sh:name "as BBB" ;
>   sh:values [
>   sh:filterShape [
>   sh:class hst:BBB ;
> ] ;
>   sh:nodes sh:this ;
> ] ;
> .
>
> This computes an inferred value that has as values the focus node itself 
> (sh:this), but declared as BBB via sh:class. It uses a filterShape to 
> return null if the focus node is NOT an instance of BBB. 
>
> You can then formulate queries such as
>
> {
>aaas {
> uri
> asBBB {
>   propB
> }
>   }
> }
>
> with an example output such as
>
> {
>   "data": {
> "aaas": [
>   {
> "uri": "
> http://ontology.mayo.edu/data-graphs/HierarchicalDataGraphTest#a1;,
> "asBBB": null
>   },
>   {
> "uri": "
> http://ontology.mayo.edu/data-graphs/HierarchicalDataGraphTest#d1;,
> "asBBB": null
>   },
>   {
> "uri": "
> http://ontology.mayo.edu/data-graphs/HierarchicalDataGraphTest#b1;,
> "asBBB": {
>   "propB": "valueB"
> }
>   },
>   {
> "uri": "
> http://ontology.mayo.edu/data-graphs/HierarchicalDataGraphTest#c1;,
> "asBBB": {
>   "propB": "valueBC"
> }
>   }
>     ]
>   }
> }
>
> Note this approach already works but is a compromise:
>
> 1) It requires changes to the ontology for all cases where you want to 
> typecast
> 2) It probably returns a different nesting in the result JSON (not sure)?
>
> Does this help?
>
> Holger
>
>
>
> On 28 Nov 2023, at 5:01 pm, Holger Knublauch  
> wrote:
>
>
>
> On 28 Nov 2023, at 3:08 pm, Davide Sottara  wrote:
>
> I have put together a simple ontology with a class hierarchy, a property 
> on each class, and one individual per class - attached
> AAA
>   DDD
>   BBB
> CCC
>
>
> Thanks for the file, which I was able to play with. I also tried something 
> like
>
> {
>aaas {
> uri
> ... on BBB {
>   propA
> }
>   }
> }
>
> but since the schema doesn't know the relationships between AAA and BBB 
> this doesn't work. All types in the generated schemas are independent, no 
> implements or such.
>
>
> I was looking for a behavior that replicates unions or interfaces:
> https://www.apollographql.com/docs/apollo-server/schema/unions-interfaces/
>
> In fact, have tried setting graphql:isInterface = true, but that does not 
> seem to have any effect?
>
>
> graphql:isInterface is only used for round-tripping GraphQL Schema files 
> from elsewhere, not those that are auto-generated.
>
> So I am afraid this syntax isn't working and you may need to revert to 
> other technologies like SPARQL or ADS JavaScript to formulate such queries.
>
> Holger
>
>
>
> Thank you for any insight\
> Davide
>
> On Wednesday, November 22, 2023 at 1:44:58 AM UTC-6 Holger Knublauch wrote:
>
>> Hi Davide,
>>
>> thanks for the error message. I had to read up on GraphQL fragments as I 
>> have never used them.
>> It seems that they would need to be declared using the fragment keyword 
>> but I don't see that in your query.
>> Our GraphQL engine does not declare such fragments automatically.
>>
>> It would streamline this discussion if we had a complete, self-contained 
>> example.
>>
>> Thanks
>> Holger
>>
>>
>> On 22 Nov 2023, at 3:59 am, Davide Sot

Re: [topbraid-users] GraphQL ...on SubClass/SubShape

2023-11-28 Thread Davide Sottara
I have put together a simple ontology with a class hierarchy, a property on 
each class, and one individual per class - attached
AAA
  DDD
  BBB
CCC

I was looking for a behavior that replicates unions or interfaces:
https://www.apollographql.com/docs/apollo-server/schema/unions-interfaces/

In fact, have tried setting graphql:isInterface = true, but that does not 
seem to have any effect?

Thank you for any insight\
Davide

On Wednesday, November 22, 2023 at 1:44:58 AM UTC-6 Holger Knublauch wrote:

> Hi Davide,
>
> thanks for the error message. I had to read up on GraphQL fragments as I 
> have never used them.
> It seems that they would need to be declared using the fragment keyword 
> but I don't see that in your query.
> Our GraphQL engine does not declare such fragments automatically.
>
> It would streamline this discussion if we had a complete, self-contained 
> example.
>
> Thanks
> Holger
>
>
> On 22 Nov 2023, at 3:59 am, Davide Sottara  wrote:
>
> Unfortunately I get an error
> "Fragment cannot be spread here as objects of type (super) can never be of 
> type (sub)
>
> On Tuesday, November 21, 2023 at 2:55:51 PM UTC-6 Holger Knublauch wrote:
>
>> Have you tried it out? What happened?
>>
>> Holger
>>
>>
>> On 21 Nov 2023, at 5:35 am, Davide Sottara  wrote:
>>
>> I have a class hierarchy, where the classes are also node shapes with 
>> property shapes
>>
>> class AA
>>propA :String
>>
>> class BB subClassOf AA
>>   propB : String
>>
>> Is a query like the following supported?
>>
>> aaas {
>>propA
>> ... on bbb {
>>  propB
>>   }
>> }
>>
>> 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 topbrai...@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-user...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/topbraid-users/efa87ebe-4872-42f7-aaa7-27fc8dcadbb1n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/topbraid-users/efa87ebe-4872-42f7-aaa7-27fc8dcadbb1n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>>
>>
> -- 
> The topics of this mailing list include TopBraid EDG and related 
> technologies such as SHACL.
> To post to this group, send email to topbrai...@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-user...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/746c10ff-c6ef-4fe3-9c4c-0ef1fa714fdcn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/746c10ff-c6ef-4fe3-9c4c-0ef1fa714fdcn%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
>

-- 
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/eb1d3a18-c776-4924-b365-8f0de0e16cc0n%40googlegroups.com.


HierarchicalDataGraphTest.trig
Description: Binary data


Re: [topbraid-users] GraphQL ...on SubClass/SubShape

2023-11-21 Thread Davide Sottara
Unfortunately I get an error
"Fragment cannot be spread here as objects of type (super) can never be of 
type (sub)

On Tuesday, November 21, 2023 at 2:55:51 PM UTC-6 Holger Knublauch wrote:

> Have you tried it out? What happened?
>
> Holger
>
>
> On 21 Nov 2023, at 5:35 am, Davide Sottara  wrote:
>
> I have a class hierarchy, where the classes are also node shapes with 
> property shapes
>
> class AA
>propA :String
>
> class BB subClassOf AA
>   propB : String
>
> Is a query like the following supported?
>
> aaas {
>propA
> ... on bbb {
>  propB
>   }
> }
>
> 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 topbrai...@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-user...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/efa87ebe-4872-42f7-aaa7-27fc8dcadbb1n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/efa87ebe-4872-42f7-aaa7-27fc8dcadbb1n%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
>

-- 
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/746c10ff-c6ef-4fe3-9c4c-0ef1fa714fdcn%40googlegroups.com.


[topbraid-users] GraphQL ...on SubClass/SubShape

2023-11-20 Thread Davide Sottara
I have a class hierarchy, where the classes are also node shapes with 
property shapes

class AA
   propA :String

class BB subClassOf AA
  propB : String

Is a query like the following supported?

aaas {
   propA
... on bbb {
 propB
  }
}

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/efa87ebe-4872-42f7-aaa7-27fc8dcadbb1n%40googlegroups.com.


Re: [topbraid-users] dash:InstancesSelectEditor with included graphs

2023-10-21 Thread Davide Sottara
That worked like a charm!
I checked the actual dataset, and we had a variety of labels, but not a 
rdfs:label

Thank you very much for the clarification
Davide

On Saturday, October 21, 2023 at 3:20:25 AM UTC-5 Holger Knublauch wrote:

> Hi Davide,
>
> I checked the source code and this component uses the auto-complete index 
> to load the values. That index requires that all resources have an 
> rdfs:label (or skos:prefLabel etc) and *the label needs to be in the same 
> graph as the rdf:type triple*.
>
> So could you please confirm that it works when you have something like
>
> foo:Value1
> a ex:Target ;
> rdfs:label "Value 1" ;
> .
>
> in the imported graph.
>
> Holger
>
>
> On 20 Oct 2023, at 9:59 pm, Davide Sottara  wrote:
>
> Hi
> I have a system with 3 graphs - Schema, Values and Catalog
>
> Schema is an Ontology that defines a NodeShape/Class "MyClass" with a 
> PropertyShape "prop", which targets a NodeShape/Class "Target", also 
> defined in Schema.
>
> ex:MyClass-prop
>   a sh:PropertyShape ;
>   sh:path ex:prop ;
>   dash:editor dash:InstancesSelectEditor ;
>   dash:viewer dash:DetailsViewer ;
>   sh:class ex:Target;
> .
>
> Values is Data Graph that contains a few instances of "Target"
>
> foo:Value1
>   a ex:Target ;
> .
> foo:Value2
>   a ex:Target ;
> .
>
> and Catalog is a Data Graph that contains the instances of MyClass.
> I need to assert, e.g.: 
>
> my:Test001
>   a ex:MyClass ;
>   prop foo:Value1
> .
>
> In the Edit UI for MyClass, the Instance Selector 
> <https://datashapes.org/forms.html#InstancesSelectEditor> does not seem 
> to recognize the "Value" individuals coming from the included graph.
> If I move them into the Catalog graph, instead, the selector works.
>
> For maintainability purposes, I would prefer to keep the Values in a 
> dedicated graph.
> Topologically:
> Values imports Schema
> Catalog imports Values
> Catalog imports Schema
>
> Am I missing something?
>
> Thank you in advance
> Davide
>
> Note: I do not currently have access to "Reference Dataset" assets
>
>
> -- 
> The topics of this mailing list include TopBraid EDG and related 
> technologies such as SHACL.
> To post to this group, send email to topbrai...@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-user...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/a6971d4d-374e-42fa-8e41-051148b6202en%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/a6971d4d-374e-42fa-8e41-051148b6202en%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
>

-- 
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/aed18bf2-1752-4ead-8ba1-4653981f0858n%40googlegroups.com.


[topbraid-users] dash:InstancesSelectEditor with included graphs

2023-10-20 Thread Davide Sottara
Hi
I have a system with 3 graphs - Schema, Values and Catalog

Schema is an Ontology that defines a NodeShape/Class "MyClass" with a 
PropertyShape "prop", which targets a NodeShape/Class "Target", also 
defined in Schema.

ex:MyClass-prop
  a sh:PropertyShape ;
  sh:path ex:prop ;
  dash:editor dash:InstancesSelectEditor ;
  dash:viewer dash:DetailsViewer ;
  sh:class ex:Target;
.

Values is Data Graph that contains a few instances of "Target"

foo:Value1
  a ex:Target ;
.
foo:Value2
  a ex:Target ;
.

and Catalog is a Data Graph that contains the instances of MyClass.
I need to assert, e.g.: 

my:Test001
  a ex:MyClass ;
  prop foo:Value1
.

In the Edit UI for MyClass, the Instance Selector 
 does not seem to 
recognize the "Value" individuals coming from the included graph.
If I move them into the Catalog graph, instead, the selector works.

For maintainability purposes, I would prefer to keep the Values in a 
dedicated graph.
Topologically:
Values imports Schema
Catalog imports Values
Catalog imports Schema

Am I missing something?

Thank you in advance
Davide

Note: I do not currently have access to "Reference Dataset" assets

-- 
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/a6971d4d-374e-42fa-8e41-051148b6202en%40googlegroups.com.