Unable to Visualize data as connected Graph

Hi Team,

Could you please advise, how can we able to see the data from virtual graph in a "graph" visualization ?

Able to identify 2 options,

  1. Selecting the query result in Stardog studio and click "visualize".
  2. With Stardog explorer .

Both didn't work for my case. Could you please tell us what is missing , to get it work ?
or do we need to get it done with external tool set ?

Below are the details !!

1. Using Stardog studio:

Selecting the results and clicking visualize, gives below result

Below is the query plan for "construct" query

From default
From named local named
From named virtual
Reduced [#280]
`─ Projection(?iri AS ?subject, ?predicate, ?object, <tag:stardog:api:context:default> AS ?context;
   +─         ?object AS ?subject, rdf:type AS ?predicate, ?object_type AS ?object, <tag:stardog:api:context:default> AS ?context;
   +─         ?object AS ?subject, <tag:stardog:studio:label> AS ?predicate, ?object_label_0 AS ?object, <tag:stardog:api:context:default> AS ?context;
   +─         ?object AS ?subject, rdfs:label AS ?predicate, ?object_label_1 AS ?object, <tag:stardog:api:context:default> AS ?context;
   +─         ?object AS ?subject, <http://purl.org/dc/elements/1.1/title> AS ?predicate, ?object_label_2 AS ?object, <tag:stardog:api:context:default> AS ?context;
   +─         ?subject, ?predicate_2 AS ?predicate, ?iri AS ?object, <tag:stardog:api:context:default> AS ?context;
   +─         ?subject, rdf:type AS ?predicate, ?subject_type AS ?object, <tag:stardog:api:context:default> AS ?context;
   +─         ?subject, <tag:stardog:studio:label> AS ?predicate, ?subject_label_0 AS ?object, <tag:stardog:api:context:default> AS ?context;
   +─         ?subject, rdfs:label AS ?predicate, ?subject_label_1 AS ?object, <tag:stardog:api:context:default> AS ?context;
   +─         ?subject, <http://purl.org/dc/elements/1.1/title> AS ?predicate, ?subject_label_2 AS ?object, <tag:stardog:api:context:default> AS ?context) [#280]
   `─ Slice(offset=0, limit=1000) [#28]
      `─ Union [#28]
         +─ VALUES (?iri) {
         │  +─ ( <http://abc.com/movies/adult> )
         │  +─ ( <http://abc.com/movies/budget> )
         │  +─ ( <http://abc.com/movies/imdb_id> )
         │  +─ ( <http://abc.com/movies/movid> )
         │  +─ ( <http://abc.com/movies/original_language> )
         │  +─ ( <http://abc.com/movies/original_title> )
         │  +─ ( <http://abc.com/movies/overview> )
         │  +─ ( <http://abc.com/movies/release_date> )
         │  +─ ( <http://abc.com/movies/revenue> )
         │  +─ ( <http://abc.com/movies/runtime> )
         │  +─ ( <http://abc.com/movies/tagline> )
         │  +─ ( <http://abc.com/movies/title> )
         │  +─ ( rdf:type )
         │  `─ ( <http://abc.com/movies/film> )
         │  }
         `─ VALUES (?iri) {
            +─ ( <http://abc.com/movies/adult> )
            +─ ( <http://abc.com/movies/budget> )
            +─ ( <http://abc.com/movies/imdb_id> )
            +─ ( <http://abc.com/movies/movid> )
            +─ ( <http://abc.com/movies/original_language> )
            +─ ( <http://abc.com/movies/original_title> )
            +─ ( <http://abc.com/movies/overview> )
            +─ ( <http://abc.com/movies/release_date> )
            +─ ( <http://abc.com/movies/revenue> )
            +─ ( <http://abc.com/movies/runtime> )
            +─ ( <http://abc.com/movies/tagline> )
            +─ ( <http://abc.com/movies/title> )
            +─ ( rdf:type )
            `─ ( <http://abc.com/movies/film> )
            }

2. Using Stardog Explorer:

tried searching for a movie name. but no luck.

Selected a database which has "fulltext search" properties enabled .

Selected Graph as "all" and also tried "selecting a particular virtual graph" in the below options.

Please advise, am i missing something / which is the right approach for graph based visualization of the data from virtual graph.

Requesting a help on this .

Thanks,
Muthu

Hi Muthu,

For complex graph visualizations, we recommend using Explorer. We have some documentation on how search works with explorer, but I will summarize here some quick instructions for your use case:

  • Resources should have at least one label property (e.g.: rdfs:label), as mentioned in the docs
  • Disable full text search, since you're searching virtual graphs
  • Enable virtual transparency in your database: virtual.transparency=True and query.all.graphs=True
  • Set graph option in Explorer to all or virtual

After all this, you should be able to search and navigate your Virtual Graph.

2 Likes

Thanks @pedro

Now i'm able to see some data in explorer by importing ontology into a stardog db with labels for a class.

Wondering with the below issue.

When i select an expand by instance and selected a particular individual.

While trying to expand an individual based on relationships , i don't find any .

But when i click "see details" i'm able to view all the relationships.

Is it how this works, or should i change something to view the relationships under this instance in a connected graph format ?

Query 2:

If i right click the movies node and select "expand by instance" and selected a value, it's coming as "no class" ? could you pls advise what should be corrected here ?

Requesting a clarification.

Attached the mapping and ontology file, that i'm using .

map.ttl (1.9 KB)
onto.ttl (8.4 KB)

Thanks in Advance,
Muthu

Hi Muthu,

Wrt you first question, the nodes you are trying to expand are literals (e.g., numbers, strings). That metadata is only available on the details tab, the graph visualization part is for resources aka other nodes that can have metadata attached to them.
Looking at map.ttl, some of your properties are indeed leading to resources, but your mappings are incorrect. Resources need to have a valid IRI, so they should be something like BIND (template("http://abc.com/producers/{companyid}") AS ?producer).

Wrt your second question, I think you need to take a look at your ontology and mappings, since there are many discrepancies. For example, properties have different names (e.g., imdb_id vs imdbId), and you need to fix your template in your mappings as referred before, so IRIs match the ones in the ontology.
I recommend starting with a smaller dataset and ontology (e.g., just one class), and work up from there.

-pedro

1 Like

Thanks @pedro for your inputs. It really , helped a lot.

After this i'm able to see the movies belonging to a particular genre, as like below, which is fine.

But, why no details for a instance of class "Movie" is getting displayed and not getting connected with the Movie node ?

Attached new mapping and ontology with reduced fields as you suggested

newmap.ttl (1.3 KB)
newonto.ttl (3.3 KB)
sampledata_csv.txt (3.9 KB)

Any thoughts on this would complete the analysis of Stardog explorer capability for us !!!

Requesting a help !!

Best regards,
Muthu

I think your data has a movie, with ID 21032, which is probably empty or lacking most fields.

Hi @pedro ,

Thanks for your response.

it's the case for all the instances in Movie node, not for a particular movie id

Moreover, i could see the details for the same node in Stardog studio

Also could find a strange behavior, when i tried to filter based on subject IRI. Hope if this get solved, then i may be able to see the details in Stardog explorer. Please Correct me if I'm wrong.

note: Tried with double quotes and single quotes appended for filter value as well like FILTER(?movies = "<http://ey.com/movies/21032>""). but no luck.

Query Plan for above query:

From default
From named local named
From named virtual
Slice(offset=0, limit=1000) [#258]
`─ Projection(?movies, ?genretriple, ?movieId, ?imdbId) [#258]
   `─ Bind(<http://abc.com/movies/21032> AS ?movies) [#258]
      `─ NestedLoopJoin(_) [#258]
         +─ NestedLoopJoin(_) [#233]
         │  +─ NestedLoopJoin(_) [#233]
         │  │  +─ VirtualGraphMongoDB<virtual://spokeAproduct> [#116] {
         │  │  │  +─ RelNode=
         │  │  │  +─    LogicalProject(imdbId=[$1])
         │  │  │  +─      LogicalFilter(condition=[AND(=($1.0, '21032':VARCHAR(2048)), IS NOT NULL($1))])
         │  │  │  +─        UnwoundRel(coll=[movies], key=[[$_id]], projection=[movieId=$id, imdbId=$imdb_id, lang=$original_language, title=$original_title])
         │  │  │  +─ Query=
         │  │  │  +─    { $match : {$and : [ {"id" : {$eq : "21032"}}, {"imdb_id" : {$exists : true, $ne : null}} ]} },
         │  │  │  +─    {$project: {imdbId: '$imdb_id'} }
         │  │  │  +─ Vars=
         │  │  │  +─    ?imdbId <- COLUMN($0)^^xsd:string
         │  │  │  }
         │  │  `─ VirtualGraphMongoDB<virtual://spokeAproduct> [#174] {
         │  │     +─ RelNode=
         │  │     +─    LogicalProject(gName=[$1])
         │  │     +─      LogicalFilter(condition=[AND(=($0, '21032':VARCHAR(2048)), IS NOT NULL($1))])
         │  │     +─        UnwoundRel(coll=[movies], unwind=[[$genres]], projection=[movieId=$id, gName=$genres.name])
         │  │     +─ Query=
         │  │     +─    {$unwind: "$genres"},
         │  │     +─    { $match : {$and : [ {"id" : {$eq : "21032"}}, {"genres.name" : {$exists : true, $ne : null}} ]} },
         │  │     +─    {$project: {gName: '$genres.name'} }
         │  │     +─ Vars=
         │  │     +─    ?genretriple <- TEMPLATE(http://abc.com/movies/{gName/0})
         │  │     }
         │  `─ VirtualGraphMongoDB<virtual://spokeAproduct> [#116] {
         │     +─ RelNode=
         │     +─    LogicalProject(movieId=[$0])
         │     +─      LogicalFilter(condition=[AND(=($2.0, '21032':VARCHAR(2048)), IS NOT NULL($0))])
         │     +─        UnwoundRel(coll=[movies], key=[[$_id]], projection=[movieId=$id, imdbId=$imdb_id, lang=$original_language, title=$original_title])
         │     +─ Query=
         │     +─    { $match : {$and : [ {"id" : {$eq : "21032"}}, {"id" : {$exists : true, $ne : null}} ]} },
         │     +─    {$project: {movieId: '$id'} }
         │     +─ Vars=
         │     +─    ?movieId <- COLUMN($0)^^xsd:string
         │     }
         `─ VirtualGraphMongoDB<virtual://spokeAproduct> [#129] {
            +─ RelNode=
            +─    LogicalProject
            +─      LogicalFilter(condition=[=($3.0, '21032':VARCHAR(2048))])
            +─        UnwoundRel(coll=[movies], key=[[$_id]], projection=[movieId=$id, imdbId=$imdb_id, lang=$original_language, title=$original_title])
            +─ Query=
            +─    { $match : {"id" : {$eq : "21032"}} },
            +─    {$limit:1}
            +─ Vars=
            +─ 
            }

Please advise.

Thanks,
Muthu