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/3f0193e9-fa48-44f8-849a-5378e520737b%40googlegroups.com.

Reply via email to