Links and attributes not displaying between classes and their instances

I am able to display instances from expanding a class. The instances are from virtual graph. The class is from a model in the DB.

Study1

What I would like to see is an edge from the class to the instance indicating a "type" relationship (equivalent to an owl NamedIndividual) like this (Excuse the poor drawing):

Study2

Also, when I select the instance and choose to "See details", why am I not seeing the attributes for the instance? Like thus:

Thanks.

1 Like

Update: I am able to display instance links now. The attributes are still not displaying though.

Hi @scottjosephson!

How did you fix it? I'm having the same issue

Thanks!

Hello Daniel, could you provide some details here? What your model looks like, what steps you are taking, observations, etc. Thanks!

1 Like

Hi @Paul_Ambro!

I declared main:Dan as both an instance of main:Man and main:Citizen.

The main issue is, the explorer is not showing the rdf:type relation between main:Dan and the main:Man and main:Citizen classes, even though if I click to see the details of main:Man or I right-click and navigate to expand node by instances, the knowledge graph is aware that main:Dan is indeed a main:Man and a main:Citizen.

There's another issue related to an rdfs:subClassOf OWL EL reasoning axiom not being displayed as well, but I've created another issue on that one.

Thanks in advance!

Here's the example file:

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix main: <http://www.example.com/> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix so: <https://schema.org/> .
@prefix stardog: <tag:stardog:api:> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix : <http://api.stardog.com/> .

<http://www.example.com/> a owl:Ontology .

foaf:gender a owl:DatatypeProperty .

main:Man a owl:Class ;
    rdfs:subClassOf foaf:Person ;
    owl:equivalentClass [
        a owl:Class ;
        owl:intersectionOf ( foaf:Person [
            a owl:Restriction ;
            owl:hasValue "man" ;
            owl:onProperty foaf:gender
        ] )
    ] .

foaf:Person a owl:Class .

main:Dan a main:Citizen , main:Man , owl:NamedIndividual .

main:Citizen a owl:Class ;
    rdfs:subClassOf foaf:Person .

main:ManCitizen a owl:Class ;
    owl:equivalentClass [
        a owl:Class ;
        owl:intersectionOf ( main:Citizen main:Man )
    ] .

And here are some screenshots:



Hi Daniel,

Stardog Explorer is written to best support data models and data written to Stardog through Stardog Designer.

In your case, you are adding all of your data model criteria and instance data to the same graph. I suggest creating a schema graph specific to your data model and a data graph for your instance data.

I made this update by creating a new data model in Studio's Model hub and pasting in your data model (removing the declaration of Dan)

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix main: <http://www.example.com/> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix so: <https://schema.org/> .
@prefix stardog: <tag:stardog:api:> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix : <http://api.stardog.com/> .

<http://www.example.com/> a owl:Ontology .

<http://xmlns.com/foaf/0.1/gender> a owl:DatatypeProperty .

<http://www.example.com/Man> a owl:Class ;
    rdfs:subClassOf <http://xmlns.com/foaf/0.1/Person> ;
    owl:equivalentClass [
        a owl:Class ;
        owl:intersectionOf ( <http://xmlns.com/foaf/0.1/Person> [
            a owl:Restriction ;
            owl:hasValue "man" ;
            owl:onProperty <http://xmlns.com/foaf/0.1/gender>
        ] )
    ] .

<http://xmlns.com/foaf/0.1/Person> a owl:Class .

<http://www.example.com/Citizen> a owl:Class ;
    rdfs:subClassOf <http://xmlns.com/foaf/0.1/Person> .

<http://www.example.com/ManCitizen> a owl:Class ;
    owl:equivalentClass [
        a owl:Class ;
        owl:intersectionOf ( <http://www.example.com/Citizen> <http://www.example.com/Man> )
    ] .

And writing the instance data for Dan to a separate graph:

prefix main: <http://www.example.com/> 

INSERT DATA {
    GRAPH <http://example/citizen_data> {

        main:Dan a main:Citizen , main:Man , owl:NamedIndividual .
    } 
}

I now see Dan's types as expected in Explorer:

1 Like

Hi @Laura_Firey!!

This was brilliant! This is now solved!

Process

1. I created a database test

2. I created a model example

3. I copied and pasted this code

@prefix ex: <http://www.example.com/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix so: <https://schema.org/> .
@prefix stardog: <tag:stardog:api:> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix : <http://api.stardog.com/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

foaf:Person a owl:Class .

foaf:gender a owl:DatatypeProperty .

<http://www.example.com/> a owl:Ontology .

ex:Man a owl:Class ;
    rdfs:subClassOf foaf:Person ;
    owl:equivalentClass [
        a owl:Class ;
        owl:intersectionOf ( foaf:Person [
            a owl:Restriction ;
            owl:hasValue "man" ;
            owl:onProperty foaf:gender
        ] )
    ] .

ex:Citizen a owl:Class ;
    rdfs:subClassOf foaf:Person .

ex:ManCitizen a owl:Class ;
    owl:equivalentClass [
        a owl:Class ;
        owl:intersectionOf ( ex:Citizen ex:Man )
    ] .

4. I performed this SPARQL query:

prefix ex: <http://www.example.com/>
INSERT DATA {
    GRAPH <http://www.example.com/data#> {
        ex:Dan a ex:ManCitizen , owl:NamedIndividual .
    } 
}

5. I opened explorer. This was the initial view

6. I expanded ex:Dan from ex:ManCitizen. All of ex:Dan's data is being displayed as expected in the detailed view. Only the rdf:type links are missing.



7. I expanded all of ex:Dan's relationships, and voila!

Final Result

Conclusion

Thank you so much @Anvitha_Anumolu, @Laura_Firey and @Paul_Ambro!

Hope this is helpful for everyone!

2 Likes