ADS add a business term

51 views
Skip to first unread message

Kasia Kryczka

unread,
Feb 27, 2024, 9:36:01 AM2/27/24
to TopBraid Suite Users
Hi, 

I would like to use ads to add business terms and I have done :
let id = tbs.createAssetCollection({
 typeLabel: "",
    name: "",
    description: ""
});

let uri = graph.namedNode(tbs.assetCollectionURI(id));



graph.transaction(uri, 'Initializing asset collection ' + id, () => {
   
     uri.add(('http://edg.topbraid.solutions/model/BusinessTerm', ('LALA')));

OR   
     uri.add(('http://edg.topbraid.solutions/model/BusinessTerm', rdfs.label('test')));
});
but they don't work. Could you give me a hint how to do that? 

Thanks,

Kasia

Holger Knublauch

unread,
Feb 27, 2024, 9:44:47 AM2/27/24
to topbrai...@googlegroups.com

On 27 Feb 2024, at 2:36 pm, Kasia Kryczka <sparql...@gmail.com> wrote:

Hi, 

I would like to use ads to add business terms and I have done :
let id = tbs.createAssetCollection({
 typeLabel: "",
    name: "",
    description: ""
});

typeLabel and name cannot be empty. But I guess that was just an example?


let uri = graph.namedNode(tbs.assetCollectionURI(id));



graph.transaction(uri, 'Initializing asset collection ' + id, () => {
   
     uri.add(('http://edg.topbraid.solutions/model/BusinessTerm', ('LALA')));

Why are there extra ( here? Should this be


?

Holger




OR   
     uri.add(('http://edg.topbraid.solutions/model/BusinessTerm', rdfs.label('test')));
});
but they don't work. Could you give me a hint how to do that? 

Thanks,

Kasia

--
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/7088b089-0527-42f3-af3c-67afcebf8a93n%40googlegroups.com.

Kasia Kryczka

unread,
Feb 28, 2024, 4:38:13 AM2/28/24
to TopBraid Suite Users
Hi,

The one with typeLabel was just an example. The extra brackets were probably from previous trials. 

Unfortunately this :

    uri.add('http://edg.topbraid.solutions/model/BusinessTerm', 'LALA'); doesn't work.

I thought wit rdfs.label would work  as this is the result we have after adding the bt manually:


<urn:x-evn-master:bbglossary/test2>
  a edg:BusinessTerm ;
  rdfs:label "test2" ;
.

Br,

Kasia

Holger Knublauch

unread,
Feb 28, 2024, 4:47:17 AM2/28/24
to 'Richard Nagelmaeker' via TopBraid Suite Users
In general, if uri is a NamedNode, and you call uri.add(string, value) it will use string as the URI of a property. In my local test this works. But are you sure you want 'http://edg.topbraid.solutions/model/BusinessTerm' as property? This looks like a class URI to me, which should be value of rdf.type.

Also if you're saying it doesn't work, what happens exactly?

Holger


Kasia Kryczka

unread,
Feb 28, 2024, 7:29:05 AM2/28/24
to TopBraid Suite Users
You are right is should be a class.

Your script worked but I got no results on Business Term.

Br,

Kasia

Reply all
Reply to author
Forward
0 new messages