Search code examples
rdfrdfsgraphdb

Domain-Range graph not displayed in GraphDB Free ver. 8.5


I loaded the following statements into an OWL-Horst repository:

@prefix : <http://example.org/owlim#>.
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

:Foo a owl:Class .
:Bar a owl:Class .
:p a owl:ObjectProperty .
:f a :Foo .
:b a :Bar .
:f :p :b .

But I cannot visualize the Domain-Range chart. I get the message "No Domain-Range graph available for '<Class_Name>'.

What is wrong with my graph?


Solution

  • [a :Foo] :p [a :Bar] does not entail :p rdfs:domain :Foo; rdfs:range :Bar. This should be an RDFS-level rule, and there is no such a rule.

    You should say explicitely:

    :p rdfs:domain :Foo .
    :p rdfs:range :Bar .
    

    Then you'll get something like this image.

    By the way, constructing domain-range graph, GraphDB performs the following query:

    SELECT DISTINCT ?prop ?propertyType ?objectPropClass (?c != :Bar as ?implicit) {
        {
            :Bar rdfs:subClassOf ?c
        }
        UNION
        {
            VALUES ?c { :Bar }
        }
        {
            ?prop a owl:ObjectProperty ;
                rdfs:domain ?c ;
                rdfs:range ?objectPropClass ;
                rdfs:domain ?objectPropClass ;
                rdfs:range ?c .
            BIND ("objectLeftRight" as ?propertyType)
            BIND (1 as ?order)
        }
        UNION
        {
            ?prop a owl:ObjectProperty ;
                rdfs:domain ?c ;
                rdfs:range ?objectPropClass .
            BIND ("objectRight" as ?propertyType)
            BIND (2 as ?order)
        }
        UNION
        {
            ?prop a owl:DatatypeProperty ;
                rdfs:domain ?c .
            BIND ("datatype" as ?propertyType)
            BIND (3 as ?order)
        }
        UNION
        {
            ?prop a owl:ObjectProperty ;
                rdfs:domain ?objectPropClass ;
                rdfs:range ?c .
            BIND ("objectLeft" as ?propertyType)
            BIND (4 as ?order)
        }
        FILTER(?objectPropClass != :Bar || ?propertyType != "objectRight"
                                        && ?propertyType != "objectLeft")
    } ORDER BY ?order ?objectPropClass ?prop
    

    Update

    ...after taking a quick look at the docs, I believed that GraphDB did a kind of analysis based on the actual use of the properties with classes instances.

    • It seems that the Class relationships view provides such information in the left panel.

    • Also, you can create your own Visual Graph configuration. I was able to CONSTRUCT this image:

      custom visual graph