Data source data not linking to ontology

The graph name you have is using a qname (prefix virtual plus local name of //Students. You'll need to enclose the graph name in angle brackets. <virtual://Students>. You should be able to test your VG without reasoning to ensure you have this bit working first.


Hi Paul,
Sorry not including the angle brackets in the post was a typo.


1 Like

They were in there. It was just the forum text formatting turned it into a link.

Can you share the ontology file you're using? I'm asking because I noticed that your diagram shows is_A instead of rdfs:subClassOf (although Tim's example did use rdfs:subClassOf) and a lives_in property on Person which might require you to enable punning but I can't remember what reasoning levels punning is supported, it might just be DL. Although this might all just be the result of not being able to tell exactly what the ontology is based on the diagram. Better to all be on the same page with what's in there. It could be that the virtual graph is not mapping to the same default namespace : that you're expecting in the query or the ctgo namespace is different in the query and the mapping, or the query is redefining the prefix with a typo. (all suggested because I've done them all :wink: )

The result of this might be that it is outside of the reasoning profile. If it is you should see errors and or warnings in the stardog.log file.

I'm pretty confident the problem will be the kind of thing that reminds me that most of our modern society can be brought to its knees with a single misplaced comma.

Thank You Tim. I tried applying your techniques from your examples and is working. I made changes to the uri and mapping file. I think the mapping was the trick to get it to work.

1 Like

Scott, glad to hear it. Please let us know if you have any more questions. Thank you!

This might be related to the problems I was facing, If I have a class called Study from my ontology. I also have a data source with a table called Studies. I have created a virtual graph containing mapping from the Studies data source. I want to have all of the data from Studies mapped to the ontology and listed as NamedIndividuals (instances). From the attached image it shows that the Study Class has 0 instances. I want that to change to the number of study records from the Studies table. Is this possible?

You definitely can. I haven't kept up with all the new UI stuff, I'm kind of a low-fi CLI kinda guy so I'm not quite sure of the exact steps that would be required there. The first question would be are you using a default mapping or are you using a custom mapping? A default mapping would use the table name and default namespace so you wouldn't see anything mapped to your "Study" class in your ontology. You'd need to create a custom mapping that explicitly set the class for the mapped instances. I'm guessing that's why you're seeing 0 instances.

Hey Scott -

By default, Explorer settings are across the default graph and do not include virtual graphs.

If you want to access virtual data in Explorer you'll need to change Explorer's settings. In the settings this can be done by updating the Graph selection to a named graph or special named that includes the data you are interested in. For instance, if you have virtual transparency enabled you can do this by selecting all to query against all named graphs including virtual graphs. You could also select the virtual graph you created from your mapping, not sure from the discussions above if this would be students_vg or Students.

More details on the settings available in Explorer in our docs, here.

1 Like