| There is a technique that allows you to declare any prefix for any API.
Put the attached file into the workspace. It is a file ending with .api.ttl. The definitions from these files are added to the ADS APIs for all context graphs.
Note you need to press Refresh on the files page in EDG Studio or restart the server or have an admin do a workspace refresh after adding an .api.ttl file.
In this particular file here, I am owl:importing the base EDG namespace that declares various classes and properties. The file is also declaring dash:generatePrefixConstants "edg", which is important.
You could use that file as a starting point and add owl:imports and dash:generatePrefixConstants to other namespaces of your choice.
(I have not tested what happens if you owl:import an asset collection, e.g. Ontology here, and I would assume it is safer to only owl:import other files)
Keep in mind that this will increase the size of all generated APIs, so if you have thousands of asset collections with different combinations of ontologies, they may cause some memory overhead, and a small overhead in API generation.
Holger
--
The topics of this mailing list include TopBraid EDG and related technologies such as SHACL.
To post to this group, send email to [email protected]
---
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/0C9C315F-72FD-4D4E-A439-4998F2D74F4D%40topquadrant.com.
|
global.api.ttl
Description: Binary data
Hi Holger,
It does explain a bit :)
In my understanding in script API viewer I can see all defined prefixes. If I would like to add more prefixes should I define them in script editor and will they be visible in all collections? The weird thing for me is that I thought if we define prefixes in the namespace and prefixes (in settings) they should be visible. Or should be define the prefixes via files?
My aim is to clean data after users :) for example add comments, subject area or anything that is missing or assigned in a bad way etc. in a bulk so I would like to have the same prefixes for all collections.
Hope this helps.
Br,
Kasia
On Monday, September 18, 2023 at 4:32:13 PM UTC+2 Holger Knublauch wrote:
Hi Kasia,
the available constants for namespace prefixes depend on the context graph. For example when a script is running from within an EDG Data Assets collection it will already know about the edg prefix as a JS object, but when it's executing within a Taxonomy it will know the skos prefix but not the edg prefix. All this is controlled by the "generate prefix constants" as mentioned in
This property is used in most of our EDG-related ontology files to declare "edg" but if your context graph doesn't import any of them, the constants will not be there, and even if you were to add a dash:generatePrefixConstants, it wouldn't know about the available classes and properties.
Does this clarify things? If not, please let me know what context (ontologies) your scripts need to run in.
Holger Hi, I have a probably simple question but when I use this: graph.select(` SELECT ?cls WHERE { ?cls rdf:type/rdfs:subClassOf* owl:Class . }`).bindings.forEach(b => { let cls = b.cls; cls.add(rdfs.comment, 'Hello World') }) everything works fine but when I want to add edg.subjectArea it says that the prefix is not defined but rdfs is somehow already defined. Where can I define all prefixes which I can use i.e., is there a place where all the prefixes are defined or we need to define then before using ?
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 [email protected]--- 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/bf8a55f1-a3f3-44ce-9b40-edf11a494415n%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 [email protected]
---
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/0C9C315F-72FD-4D4E-A439-4998F2D74F4D%40topquadrant.com.
|