Not all relationship are displayed?

I am seeing in the Studio, only user defined classes are displayed in the visualization, not built-in classes, i.e. xsd:string. For example, in the tutorial:

The visualized schema only shows 'Actor actedIn Movie', but it doesn't have:

:hasName rdf:type rdf:Property . 
 :hasName rdf:range xsd:string .

For a query:
DESCRIBE :nm0000102

I can't see the title of the movie, since it doesn't show the title or year of the movie, because in the schema it doesn't show these below:

:hasTitle rdf:type rdf:Property ; 
      rdfs:range xsd:string .
    :hasYear rdf:type rdf:Property ;
      rdfs:range xsd:integer .

How to show all the relationships in the graph visualization?

You're right, the visualized schema only shows the reasoning schema, focusing on classes and relationships. If you want to show the entire schema including the literals, you can run (and visualize) Query 1 below in a regular query window. I think that will give you what you're looking for.

However, the reason that year and title don't show up in the results of the DESCRIBE query is not related to the schema but to definition of DESCRIBE. The default DESCRIBE on an IRI finds all triples where that IRI is the subject. So it will only display the IRIs of the movies, not information about those movies. To get that information, you could click on any node in the output of the DESCRIBE, out you could write a CONSTRUCT query like Query 2 (which you could further restrict to only include literal values). Also, Stardog supports the ability to write a custom DESCRIBE query that you use, see an example here:

Query 1

    ?domain ?prop ?range
    ?subject ?prop ?object .
    ?subject a ?domain .
    optional {
        ?object a ?oClass .
    bind(if(bound(?oClass), ?oClass, datatype(?object)) as ?range)
    filter (?prop != rdf:type && ?prop != rdfs:domain && ?prop != rdfs:range)

Query 2

     :nm0000102 ?p ?o .
    ?o ?p2 ?o2
 :nm0000102 ?p ?o .
    ?o ?p2 ?o2

Just noticed that there are 2 visualization places in the Studio, one under database -> schema and the other is under the query result page.

A typical usage of visualizing the full schema instead of only classes is that, let's see I designed a KG schema and want to export the visualized graph to be inserted into a PPT for presentation, that would be only a partial schema. For the movie example in the Tutorial, the it only contains:
:Actor :actedIn :Movie

And it will lack:
:Actor :hasName xsd:String
:Movie :hasTitle xsd:String
:Movie :hasYear xsd:Date

Clearly, it's a very incomplete visualization of the graph schema. Is there a plan to support the full schema visualization directly under the database -> schema tab in next release, without writing the Query 1 to get the effect?

Yes, we use the same style of visualization in both places. And yes, we are working on improving the schemas we will use in the schema section while preserving the ability to use it as a jumping off point in case you want to customize further. I'm not sure it will be in the next release but should be coming out relatively soon.

Thanks for all the feedback, we appreciate it!

Hi, Simon:
Just to make sure I understand correctly the current status of the visualization and what I can do:

  1. In both visualization places, it only displays classes and relationships.
  2. For your suggested Query 2, I tried and it still didn't display hasName and hasTitle relationships. Why is that?
  3. How to display the actual individual string names, instead of the code like 'tt3813310'?

  1. In the schema visualization it will only display the results of the default schema query. In the "general" visualization from the query result section, it will display the results of whatever CONSTRUCT or DESCRIBE query that you want.

  2. By default, we do not show relations with literals on the graph and we show them in the bottom information section when you click on a node. We did this initially to prevent a large number of strings from overcrowding the graph. However, in the recent 1.13 release we added the ability to show them on the graph - that option is in the settings gear (bottom right icon row, furthest right icon) with the option Show Literals as Nodes

  3. Right now there is no way to show anything on a node but the IRI. But in the next release of Studio we're adding a configuration that will allow you to configure which property you want to use to label the nodes. Typically it's something like rdfs:label which is not included in this dataset but you could add it.

The 'Show Literals as nodes' feature is cool. I am looking at this music example:

Where I can see in the graph no full IRI is shown, only class name, like 'Song'. But when I load the data and display it, on the graph the full IRI is displayed, which is crowded. How to avoid displaying the full IRI as done in that post? Seems like I didn't find a setting to control that but curious how it's achieved in the tutorial.

Please see the graph export.

Does your database have a namespace (you check by going to the databases section, selecting the database you're using, and then choosing the Namespaces option along the top)? If you have that as a namespace, it should reflect in the text on the nodes.

No. Please see the screenshot.

Got it. Then please add it. You can use the prefix tutorial or tut if you want to preserve as the default. Or if you give that a prefix (like stardog), you can leave the prefix blank for this one so that no prefix shows up on the visualization.

That's cool and thanks!

For the movie tutorial, and the music tutorial as well, there is a data and schema ttl file respectively. Even though the data model is defined in the schema file, when I created a database for the 'data' ttl file only, and executes the Query 1 you provided, I can still get the schema output. Don't the schema and data files need to used together? The 'data' ttl doesn't contain schema information, right? Why can I still search for the schema in it?

The term schema is a bit overloaded - in some cases it's used to mean the structure of the data as revealed in the data itself. That's that Query 1 is looking for. In other cases it's meant to describe wha that explicitly articulated schema is using concepts like class, sublcass, domain, and range. That's what the schema visualization section is querying and showing.

I think the best resource we have for this is our post on RDF, specifically this section about the RDF Schema:, though the whole post may be helpful.

Good. So the use of data ttl doesn't depend on the schema file, and it encompasses it.