Hi Hamid, did you set these properties for your namespace in the ontology?
For example if your namespace has the prefix "myprefix" then set generate prefix constants to "myprefix" and you SHOULD be able to write things like let newAsset = graph.namedNode(URI); newAsset.add(rdf.type, myprefix.SampleObject); Likewise, if you state generate prefix classes "myprefix" you may be able to just do let newAsset = myprefix.createSampleObject(...) (Assuming the script editor panel is in write mode using the lock button of the upper right corner, and that you have refreshed the API after changes to the prefixes as above) Holger > On 16 Sep 2022, at 7:42 am, Hamid Abdirad <[email protected]> wrote: > > Hi all, > I am wondering if there is a better set of guides for using ADS and > ScriptEditor, especially for creating assets based on custom ontologies > included in Data Graphs. > I looked at the following and API guide, but they did not help me much: > https://archive.topquadrant.com/doc/7.1/scripting/introduction.html > > More specifically, I am trying to use graph.add to create and persist triples > but I do not know how to use classes from a custom ontology inside arguments. > > Let's say I have included custom ontology1 and it has Thing > SampleObject as > public classes. Using the ADS in my data graph, how can I create a new asset > that is a SampleObject: > graph.add(URI, rdf.type, WHAT_TO_PUT_HERE?) > > I tried things like ontology1.SampleObject, but it does not show as an asset. > Looking at the preview of the script run, it is not being consider a valid > triple. > > Thank you, > Hamid > > > -- > 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] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/topbraid-users/c58a9d35-c71a-4467-8835-e9a41d0b1d5cn%40googlegroups.com > > <https://groups.google.com/d/msgid/topbraid-users/c58a9d35-c71a-4467-8835-e9a41d0b1d5cn%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/8C49B38E-A412-4552-B2C1-8C8B956B4989%40topquadrant.com.
