Thank you very much for your additional advice.

"Not well-formed tuples" is likely the wrong terminology. To put things 
literally, I currently am producing the first example below, and I need to 
be producing the second example below.

First example:
<https://schema.somecompany.com/ontologies/scorg#b363fc0a-
2c2c-11b2-80af-001dd8b72b91>
       <http://www.w3.org/2004/02/skos/core#prefLabel>
               "A1" , "A2" , "A3";
       <https://schema.somecompany.com/ontologies/somecompany_organization#
org_id>
               "Acme" , "Bachman" , "Connor" .


Second example:
scorg:b363fc0a-2c2c-11b2-80af-001dd8b72b91
  <https://schema.somecompany.com/ontologies/somecompany_organization#org_id> 
  "A1" ;
  rdf:type  <https://schema.somecompany.com/ontologies/somecompany_orga
nization#CLASS-7d2934e2-2c2b-11b2-8097-001dd8b72b91> ;
  <http://www.w3.org/2004/02/skos/core#prefLabel>  "Acme" .

scorg:b363fc0a-2c2c-11b2-80af-001dd8b72b91
 <https://schema.somecompany.com/ontologies/somecompany_organization#org_id> 
  "A2" ;
 rdf:type  <https://schema.somecompany.com/ontologies/somecompany_orga
nization#CLASS-7d2934e2-2c2b-11b2-8097-001dd8b72b91> ;
 <http://www.w3.org/2004/02/skos/core#prefLabel>  "Bachman" .

scorg:b363fc0a-2c2c-11b2-80af-001dd8b72b91
<https://schema.somecompany.com/ontologies/somecompany_organization#org_id> 
  "A3" ;
rdf:type  <https://schema.somecompany.com/ontologies/somecompany_orga
nization#CLASS-7d2934e2-2c2b-11b2-8097-001dd8b72b91> ;
<http://www.w3.org/2004/02/skos/core#prefLabel>  "Connor" .



On Friday, January 17, 2020 at 4:10:45 PM UTC-5, Irene Polikoff wrote:
>
> Are you saying that your SPARQL generates label and id triples, but fails 
> to generate type triples such as
>
> scorg:b363fc0a-2c2c-11b2-80af-001dd8b72b91
>    rdf:type  <
> https://schema.somecompany.com/ontologies/somecompany_organization#CLASS-7d2934e2-2c2b-11b2-8097-001dd8b72b91>
>  
> ;
>
>
> And this is your problem?
>
> I am confused by your terminology of “not well-formed tuples”. I am not 
> sure what this means in this context. Do you mean that some triples that 
> you are expecting to generate for each subject are missing?
>
> This would happen if a variable you are using to construct triples was 
> unbound.
>
> For example:
>
> SPARQL INSERT {?s a ?o1.
> ?s rdtfs:label ?o2.}
>
> If let's say ?o1 was unbound then you would not get the type triple. If 
> ?o2 was unbound, you would not get the label triple. If ?s was unbound you 
> would not get neither of the triples.
>
> On Jan 17, 2020, at 3:35 PM, Michael Phelan <[email protected] 
> <javascript:>> wrote:
>
> The RDF I provided at the beginning was entirely produced using the 
> TopBraid EDG web interface's taxonomy editor. My goal is to produce a large 
> number of tuples in the same taxonomy which have the same form as the A1 
> test org, but with details taken from the data provided by the JSON 
> document. At present, the SPARQL I provided produces the org_id tuple data 
> in a comma-delineated list, based on runs to my localhost EDG server. I am 
> providing an abbreviated version of the RDF that the current SPARQL 
> produces, below.
>
> # baseURI: urn:x-evn-master:somecompany_organizations1_3
> # imports: http://topbraid.org/imported
> # imports: http://topbraid.org/skos.shapes
>
> @prefix metadata: <http://topbraid.org/metadata#> .
> @prefix teamwork: <http://topbraid.org/teamwork#> .
> @prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
> @prefix owl:   <http://www.w3.org/2002/07/owl#> .
> @prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
> <
> https://schema.somecompany.com/ontologies/scorg#b363fc0a-2c2c-11b2-80af-001dd8b72b91
> >
>         <http://www.w3.org/2004/02/skos/core#prefLabel>
>                 "A1" , "A2" , "A3";
>         <
> https://schema.somecompany.com/ontologies/somecompany_organization#org_id>
>                 "A1" , "A2" , "A3" .
>
> <urn:x-evn-master:somecompany_organizations1_3>
>         a                owl:Ontology ;
>         rdfs:label       "somecompany_organizations1_2" ;
>         metadata:status  metadata:UnderDevelopmentStatus ;
>         <http://topbraid.org/swa#defaultNamespace>
>                 "
> http://example.org/taxonomies/somecompany_organizations1_2#"; ;
>         teamwork:newInstancesUserCannotModifyURI
>                 false ;
>         owl:imports      <http://topbraid.org/skos.shapes> , <
> http://topbraid.org/imported> .
>
>
>
> On Friday, January 17, 2020 at 10:14:04 AM UTC-5, Irene Polikoff wrote:
>>
>> There are 3 triples here: id, label and type
>>
>> scorg:b363fc0a-2c2c-11b2-80af-001dd8b72b91
>>    <https://schema.somecompany.com/ontologies/somecompany_
>> organization#org_id>   "A1" ;
>>    rdf:type  <https://schema.somecompany.com/ontologies/somecompany_
>> organization#CLASS-7d2934e2-2c2b-11b2-8097-001dd8b72b91> ;
>>    <http://www.w3.org/2004/02/skos/core#prefLabel>  "test org" .
>>
>>
>> They all look fine syntactically.
>>
>> What do you mean by ‘not well formed’?
>>
>>
>> On Jan 17, 2020, at 9:55 AM, Michael Phelan <[email protected]> wrote:
>>
>> I am pasting the Taxonomy a second time, as there was a typo in one of 
>> the namespace references.
>>
>> # baseURI: urn:x-evn-master:somecompany_organizations
>> # imports: http://topbraid.org/skos.shapes
>> # imports: http://topbraid.org/teamworkconstraints
>> # imports: urn:x-evn-master:somecompany_organization
>>
>> @prefix metadata:  <http://topbraid.org/metadata#> .
>> @prefix scorg:  <https://schema.somecompany.com/taxonomies/somecompany_
>> organizations#> .
>> @prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
>> @prefix owl:  <http://www.w3.org/2002/07/owl#> .
>> @prefix teamwork:  <http://topbraid.org/teamwork#> .
>> @prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
>>
>> scorg:CONCEPTSCHEME-7d2934e3-2c2b-11b2-8097-001dd8b72b91
>>    <http://www.w3.org/2004/02/skos/core#hasTopConcept> 
>>  scorg:b363fc0a-2c2c-11b2-80af-001dd8b72b91 ;
>>    rdf:type      <http://www.w3.org/2004/02/skos/core#ConceptScheme> ;
>>    rdfs:label    "some company Organizations" ;
>>
>>     rdfs:comment  "Concept scheme for some company Import Service" .
>>
>>
>> <urn:x-evn-master:somecompany_organizations>
>>    rdf:type         owl:Ontology ;
>>
>>     owl:imports      <http://topbraid.org/skos.shapes> ;
>>
>>     rdfs:label       "somecompany_organizations" ;
>>
>>     rdfs:comment     "some company Organization Taxonomy for 
>> Organization Import Service" ;
>>
>>     <http://topbraid.org/swa#defaultNamespace>  "
>> https://schema.somecompany.com/taxonomies/somecompany_organizations#"; ;
>>    owl:imports      <urn:x-evn-master:somecompany_organization> ;
>>
>>     metadata:status  metadata:UnderDevelopmentStatus .
>>
>>
>> scorg:b363fc0a-2c2c-11b2-80af-001dd8b72b91
>>    <https://schema.somecompany.com/ontologies/somecompany_
>> organization#org_id>   "A1" ;
>>    rdf:type  <https://schema.somecompany.com/ontologies/somecompany_
>> organization#CLASS-7d2934e2-2c2b-11b2-8097-001dd8b72b91> ;
>>    <http://www.w3.org/2004/02/skos/core#prefLabel>  "test org" .
>>
>>     <http://evn.topbraidlive.org/evnprojects#Taxonomy>
>>    rdfs:subClassOf  teamwork:Vocabulary .
>>
>>
>> teamwork:Vocabulary  rdfs:subClassOf  owl:Ontology .
>>
>>
>> <urn:x-evn-master:somecompany_organizations>
>>    rdf:type     teamwork:Vocabulary ;
>>
>>     owl:imports  <http://topbraid.org/teamworkconstraints> ;
>>
>>     rdf:type     <http://evn.topbraidlive.org/evnprojects#Taxonomy> .
>>
>>
>>
>> On Friday, January 17, 2020 at 9:08:37 AM UTC-5, Michael Phelan wrote:
>>>
>>> I am writing a batch job which adds tuples to a Taxonomy in TopBraid 
>>> EDG. I am struggling with adding well-formed tuples. I would appreciate 
>>> some guidance on where my approach is falling short.
>>>
>>> An example of the end-state of the Taxonomy after one record has been 
>>> inserted (though ultimately there will be many records inserted) is below, 
>>> with private details removed. The tuple which I am struggling to add has 
>>> this as its first line:
>>> scorg:b363fc0a-2c2c-11b2-80af-001dd8b72b91
>>>
>>> # baseURI: urn:x-evn-master:somecompany_organizations
>>> # imports: http://topbraid.org/skos.shapes
>>> # imports: http://topbraid.org/teamworkconstraints
>>> # imports: urn:x-evn-master:somecompany_organization
>>>
>>> @prefix metadata:  <http://topbraid.org/metadata#> .
>>> @prefix scorg:  <
>>> https://schema.somecompany.com/taxonomies/somecompany_organizations#> .
>>> @prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
>>> @prefix owl:  <http://www.w3.org/2002/07/owl#> .
>>> @prefix teamwork:  <http://topbraid.org/teamwork#> .
>>> @prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
>>>
>>> morg:CONCEPTSCHEME-7d2934e3-2c2b-11b2-8097-001dd8b72b91
>>>     <http://www.w3.org/2004/02/skos/core#hasTopConcept>  
>>> scorg:b363fc0a-2c2c-11b2-80af-001dd8b72b91 ;
>>>     rdf:type      <http://www.w3.org/2004/02/skos/core#ConceptScheme> ;
>>>     rdfs:label    "some company Organizations" ;
>>>
>>>     rdfs:comment  "Concept scheme for some company Import Service" .
>>>
>>>
>>> <urn:x-evn-master:somecompany_organizations>
>>>     rdf:type         owl:Ontology ;
>>>
>>>     owl:imports      <http://topbraid.org/skos.shapes> ;
>>>
>>>     rdfs:label       "somecompany_organizations" ;
>>>
>>>     rdfs:comment     "some company Organization Taxonomy for 
>>> Organization Import Service" ;
>>>
>>>     <http://topbraid.org/swa#defaultNamespace>  "
>>> https://schema.somecompany.com/taxonomies/somecompany_organizations#"; ;
>>>     owl:imports      <urn:x-evn-master:somecompany_organization> ;
>>>
>>>     metadata:status  metadata:UnderDevelopmentStatus .
>>>
>>>
>>> scorg:b363fc0a-2c2c-11b2-80af-001dd8b72b91
>>>     <
>>> https://schema.somecompany.com/ontologies/somecompany_organization#org_id>  
>>>  "A1" ;
>>>     rdf:type  <
>>> https://schema.somecompany.com/ontologies/somecompany_organization#CLASS-7d2934e2-2c2b-11b2-8097-001dd8b72b91>
>>>  
>>> ;
>>>     <http://www.w3.org/2004/02/skos/core#prefLabel>  "test org" .
>>>
>>>     <http://evn.topbraidlive.org/evnprojects#Taxonomy>
>>>     rdfs:subClassOf  teamwork:Vocabulary .
>>>
>>>
>>> teamwork:Vocabulary  rdfs:subClassOf  owl:Ontology .
>>>
>>>
>>> <urn:x-evn-master:somecompany_organizations>
>>>     rdf:type     teamwork:Vocabulary ;
>>>
>>>     owl:imports  <http://topbraid.org/teamworkconstraints> ;
>>>
>>>     rdf:type     <http://evn.topbraidlive.org/evnprojects#Taxonomy> .
>>>
>>> The means by which I am attempting to add these tuples is via SWP and 
>>> SPARQL.
>>>
>>> The data is brought in from a RESTful service in JSON format. The 
>>> sml:ImportTextFromURL function GETs the JSON data, which is subsequently 
>>> assigned to a JSON object via the ui:json function.
>>>
>>> The query graph is then set via ui:setContext ui:queryGraph. The query 
>>> graph is set to the taxonomy via the IRI function, with the following value.
>>> urn:x-evn-master:somecompany_organizations
>>>
>>> The JSON attribute-value pairs are subsequently assigned to variables 
>>> within the SPARQL insert statement using BIND.
>>>
>>> The SPARQL insert statement is below. There are problems with this 
>>> statement. I can insert the skos:prefLabel and the org_id to be 
>>> well-formed, but adding anything further results in badly formed RDF. I am 
>>> hoping that I may get some guidance from the community as to how to modify 
>>> this insert statement so that it produces well-formed tuples of the format 
>>> provided above. The example tuple above has this as its first line:
>>> scorg:b363fc0a-2c2c-11b2-80af-001dd8b72b91
>>>
>>> Thank you in advance for any insights.
>>>
>>> <ui:update ui:updateQuery="{!
>>>     INSERT {
>>>         ?tbeOrgID a &lt;
>>> https://schema.somecompany.com/ontologies/somecompany_organization#CLASS-7d2934e2-2c2b-11b2-8097-001dd8b72b91&gt;
>>>  
>>> .
>>>         ?division skos:prefLabel ?orgNameString .
>>>         ?division &lt;
>>> https://schema.somecompany.com/ontologies/somecompany_organization#org_id&gt;
>>>  
>>> ?orgString .
>>>     }
>>>     WHERE {
>>>         BIND (ui:jsonValue(?json, &quot;results&quot;) AS ?array) .
>>>         ?array ui:jsonArrayMembers ?object .
>>>         BIND (ui:jsonValue(?object, &quot;org_id&quot;) AS ?orgID) .
>>>         BIND (ui:jsonString(?orgID) AS ?orgString) .
>>>         BIND (spif:buildURI(&quot;
>>> https://schema.somecompany.com/ontologies/scorg#b363fc0a-2c2c-11b2-80af-001dd8b72b91&quot;)
>>>  
>>> AS ?division) .
>>>         BIND (ui:jsonValue(?object, &quot;org_name&quot;) AS ?orgName) .
>>>         BIND (ui:jsonString(?orgName) AS ?orgNameString) .
>>>         BIND (spif:generateUUID() AS ?tbeOrgID) .
>>> } }"/>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "TopBraid Suite Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/topbraid-users/665217d7-73ef-4ab2-bed0-161af0fa3569%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/topbraid-users/665217d7-73ef-4ab2-bed0-161af0fa3569%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/96b4409a-c54c-40e5-ab9a-b9860d12d9a1%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/96b4409a-c54c-40e5-ab9a-b9860d12d9a1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/04b16ed9-be18-479b-ba6b-1981006798ac%40googlegroups.com.

Reply via email to