Are all newly created classes also node shapes?

Yes, EDG will make every new class a node shape.

What if I have a pre-existing class that is not a shape? How to make it a shape?

Click on Modify menu and select “Enable SHACL constraints”.

How do I add properties to a class?

Select a class:

  • Use the “+” icon in the class form – next to declared properties field OR

  • Use Create icons in the Property Groups panel

Can I “base” a class on another class (or a node shape on another shape)?
  • Yes. You can clone a class or a node shape. However, property shapes will not be cloned. Properties shapes associated with class 1 will be associated with class 2.

  • If you want to create new property shapes for your new class, use Modify menu, then Clone property shapes from …. You can even get some properties from Wikidata.

Can I create OWL restrictions and other class axioms?

Yes, for certain fields on the classes form, you can switch to the OWL Manchester Syntax editor.

You can also use the source code panel.

Can I create node shapes that are not classes? Why would I do this?

Yes. Use Create button on the Node Shapes panel. There are several reasons to do this. For example:

  • You may want to define a different alternative view on instances of a class. You can create node shapes, explicitly target a class and associate these views with governance roles.

  • You may need to use a different target than members of a given class.

What happens with instances if a class is deleted?

They remain. Delete instances before deleting classes. Instances are typically in another asset collection. Use Explore menu Find Usages in Other Asset Collections…

How do I change the rdfs:subClassOf relationship?

You can use drag and drop to re-arrange class hierarchy.

If you want to have multiple parent classes, then use the class form and edit superclasses field.

What happens to the child classes when a parent is deleted?

To also delete subclasses, use Delete with subclasses.

If a class has no parents, you will no see it in the Class Hierarchy panel. But you will see it in the Class List panel and will be able to navigate to it using navigation options.

How do I see all properties associated with a class?

If they are associated via shapes, on the class form or in the Property Groups panel.

If they are associated only using RDFS domain/range or OWL restrictions, use References panel.

I have ontology in RDFS/OWL, how do I create shape declarations from it?

Go to Transform tab > Convert OWL Axioms to SHACL Constraints.

Can I annotate classes using properties that are not shown on the class form?

Yes. Source code is always an option. You can also get new fields to show up on forms, if you tell EDG that you want to use additional properties to describe classes (or properties or other schema resources). There are two ways of doing this:

Option 1

Create a new node shape, make Class its target.

Add to it properties you want to use e.g., skos:definition.

On the class forms, you will now have a drop down to switch from the regular view to a view that lets you see and edit your additional annotations.

Option 2

Modify the default system forms for classes that are defined in metash.ttl by injected extra fields into them.

Can a SPARQL query reference a resource that is selected in the form panel?

Yes, by using $this in a SPARQL query, you can reference resources that you currently have selected in the form panel. For example:

    $this ?p ?o


Can I use MariaDB as a database type?

Yes, with a caveat that it requires a workaround. You will need to set databaseMetaData.getDatabaseProductName to return true. For example mysql://localhost:3306/edg?useMysqlMetadata=true.

I am getting errors about .lock files in my logs.

To clear this issue, you will need to shut down Tomcat and remove the *.lock files. Once Tomcat is fully shut down, navigate to the root of your workspace in a terminal then issue the following commands:

View all lock files:

$ find . -name tdb.lock -execdir ls – '{}'

Recursively remove all lock files:

$ find . -name tdb.lock -execdir rm – '{}'

Once all the lock files are removed, you should be able to safely restart Tomcat.

Invalid URIs

Although rare, invalid URIs can occur in an EDG workspace’s graphs. EDG prevents invalid URIs from being added via imports and edits but at times customers can bring in this data from other means. When exporting a collection with an invalid URI, the export will contain a truncated (and likely unusable) Turtle file of the graph that contained the invalid data.

If the EDG workspace contains invalid URIs, those URIs must be either deleted or changed to valid URIs before an export can succeed. The SPARQL query below will return a list of the invalid URIs in an EDG workspace, along with each URI’s graph and triple position (subject, predicate, or object):

PREFIX teamwork: <http://topbraid.org/teamwork#>
SELECT ?graph ?bad_uri ?position
    { () teamwork:graphsUnderTeamControl ?graph }
    { () teamwork:graphsUnderTeamControl (?x ?graph) }
    GRAPH ?graph {
        SELECT DISTINCT ?bad_uri ?position {
            { ?uri ?p1 ?o1 . FILTER (isIRI(?uri) && !COALESCE(isIRI(IRI(STR(?uri))), false)) . BIND ("subject" AS ?position) }
            { ?s2 ?uri ?o2 . FILTER (isIRI(?uri) && !COALESCE(isIRI(IRI(STR(?uri))), false)) . BIND ("predicate" AS ?position) }
            { ?s3 ?p3 ?uri . FILTER (isIRI(?uri) && !COALESCE(isIRI(IRI(STR(?uri))), false)) . BIND ("object" AS ?position) }
            BIND (STR(?uri) AS ?bad_uri)
ORDER BY ?graph ?bad_uri DESC(?position)

If an invalid URI cannot be repaired using the EDG UI (e.g. if the URI is in a .tch graph), then an ADS script like the one below can be used to repair a graph’s invalid URIs. This example will replace any spaces in object URIs in the geo.tch graph with underscores:

graph.transaction('urn:x-evn-master:geo.tch', 'Repairing invalid URIs', () => {
    let triples = graph.triples(null, null, null, true);
    triples.forEach(t => {
        if (t.object.isURI() && t.object.uri.includes(' ')) {
            graph.remove(t.subject, t.predicate, t.object);
            graph.add(t.subject, t.predicate, graph.namedNode(t.object.uri.replaceAll(' ', '_')));