OWL RDF ontology uploaded as database but not visualizing in Explorer

I've created a database in Stardog Studio by uploading and OWL / RDF / XML file created in Stanford webProtege. The DB uploads successfully, and I can see that all the nodes are present, but I can't make any sense of them in Explorer, e.g. the visualisation attached

Hitting "Visualiza" straight from the Explorer landing page simply results in the message "No results".

If feels like the ontology meta-data is not being understood, but I'm not sure how to go about defining it.

Thanks in advance for any support!

I have the same problem. I think you need to do something like tell Stardog which graph to use to look for the TBox info but I used to be able to do this but in newer versions of Stardog I couldn't get this to work either. I think it is a fairly minor problem but I'm interested in the answer as well.

Michael DeBellis
https://www.michaeldebellis.com/blog

1 Like

Still hoping someone could help me with this. My database and schema seem properly configured when viewing through Studio. I can tell with Studio sparql queries that my data, properties and relationships are all there. I can also (laboriously) find named individuals in Explorer. I can visualize and navigate the Schema perfectly. But I cannot visualize or navigate the named individuals, properties or relationships in Explorer with any sense.

Feels like I'm missing a trick.

Any nudges hugely appreciated.

Check out this short training video on how to load a data model. It will walk you through the steps you need to take in order to view your data model in Explorer. If you don't already have a free account on Stardog Academy, you will be asked to create one before watching this video.
Loading a Data Model

Thank you Helen for your mail and the video. I watched it and implemented the steps exactly as directed. However, I’m still seeing the same behaviour as before: Namely: After uploading the data and defining the model, I can properly see all my data via SPARQL queries in Studio. I can also perfectly visualize and interrogate the schema in Explorer, and in Designer. However, when I try interrogate named individuals (which I can see via SPARQL in Studio) via Explorer, I always get ā€œNo resultsā€. This behaviour is also true when using the Explorer Query Builder, and when clicking on a result in Studio and selecting ā€œVisualizeā€. I believe by database and schema are correctly selected in Explorer and I have reasoning enabled.

I’m quite anxious to get a basic PoC with this graph and VoiceBox working so I demonstrate the platform to my employer. I’m certain that this must be a simple issue that’s easily resolved. Any assistance would be greatly appreciated.

Best,

./charl

Orange_Cyberdefense_RGB_Small_Logo_Black_Text_2.png

Charl,
Would you mind sharing the file. I can load it and see where the problem might lie.
You're welcome to email to joe.fagan@stardog.com
Thanks
Joe

Thank you Joe! I understand Steve as invited you to the endpoint?

Oh great.
Please try Explorer now and see whether it is what you expect.
I executed the following Sparql Update query

update_query1.rq (196 Bytes)

This copies instance data from the data model to a named graph :data
If everything is fine, we can also remove them from your model, and explain what the issue is
Thanks
Joe

Hello Helen, thanks, however, a video does not work for me, too fast, I need written text. The text instructions in docs for creating a database and uploading an RFD file in Studio (with numbered steps and screenshots) were fine for me. Is there a similar instruction for viewing the data model in Explorer?

Thanks Joe. A quick test of Explorer shows that functions like search are now working as expected, but I still don't see properties or relationships for named individuals. E.g.

OK I've copied more data triples from your model to :data

The issue is that you cannot have both ABox (instance data) and TBox (model and reasoning triples) in your data model. All Data Model (or Ontology) triples should be in your Data Model named graph. All instance data and relationships should be in a separate named graph.

Please try now. I've copied much of your data triples to :data
update_query2.rq (264 Bytes)

Thanks
Joe

The issue is that you cannot have both ABox (instance data) and TBox (model and reasoning triples) in your data model. All Data Model (or Ontology) triples should be in your Data Model named graph. All instance data and relationships should be in a separate named graph.

I've been lurking because I'm having the same problem with an ontology I developed in Desktop Protege. I have other things that are higher priority so haven't even had a chance to go through that tutorial yet. But that is probably the same issue I was having. Protege has no notion of a graph (at least not in the user interface) because it works at the logical level. It always puts ABox and TBox in the same file so if I'm understanding correctly this means you just can't take a Protege file and import it directly and expect it to work. You need to first do something like use SPARQL to put the TBox and ABox in different graphs. I'm assuming you could also do this after the fact, load a Protege file with TBox and ABox together into Stardog and then run a SPARQL query in Stardog to put TBox in one graph and ABox in another graph (or load everything into default graph then move ABox to a data graph). In fact, you would have to do it that way (or use some other tool) because the SPARQL tools in Protege are essentially just for learning, neither of them implements the full specification and they both leave out many significant things (e.g., neither has INSERT or DELETE, Snap SPARQL can't have wildcards in the predicate position, etc.). So I would be very surprised if you can do things with named graphs in either Protege SPARQL tool. Just wanted to make sure I'm understanding that correctly, if not please let me know. Thanks

Michael DeBellis
https://www.michaeldebellis.com/blog

Michael,

yes, you’ve understood it well. Protege doesn't distinguish between named graphs; everything goes into a single RDF graph. That’s fine for many ontology development tasks, but it does mean that when you’re preparing data for use in the real world, you’ll want to separate the ABox and TBox into distinct named graphs. I don't know Proetege very well, but perhaps you could have a separate project for your ABox triples, and so you would have a separate files. Alternatively just don't use Protege for your ABox triples at all. This separation of ABox and TBox is not a Stardog thing. It's generally true that you should not query TBox triples when reasoning is enabled, and if all your data is in your TBox you're in a bind.

If however, you do end up with instance data and relationships in your TBox, as you've seen, you can move them.

Happy to help with SPARQL queries to move your data if that helps!

Thanks
Joe

1 Like

Thanks Joe, I agree with everything you said. I usually just use Protege for model development but I always include test data as part of model development but for real data (millions of triples or more) Protege can't handle it anyway, it is an ontology design tool not a graph database and I think it is an excellent idea to enforce the best practice of having TBox and ABox in different graphs. I'm pretty literate in SPARQL but if I get stuck I'll let you know.

Michael

2 Likes

Thank you everyone! This now works (almost) exactly as expected, and works well enough for me to make my points internally with my team. I've learned alot - about the platform and my data.

@Michael_DeBellis1 thank. you for your valuable inputs also.

2 Likes

Dick

To explore a model in Explorer we need to let Stardog know that the named graph the model was loaded to, actually contains a model. We do this by modifying the database property reasoning.schemas

Here's how to modify the reasoning.schemas database property

  • Choose a name for your model Eg ā€˜ont’. This is the name that Studio, Designer and Explorer will use when you select a model in the drop-down list.
  • In Studio, select Database pod on Left hand pane 2nd from bottom.
  • Select your database
  • Select Properties
    • In search bar enter ā€˜schemas’ and locate the reasoning.schemas property
    • Set the reasoning.schemas property to ont=urn:myModel where ont is the name you chose and urn:myModel is the named graph that contains the model. The property is a collection of comma separated model=named_graph_IRI pairs. If there are already models specified, append the new model to the string, as shown.

To View the model in Explorer

  • In Explorer select the database
  • In settings, in the model dropdown choose the model, eg ont. This is the name you gave the model above.

Guidelines for creating a model that is optimised for Explorer

Most ontologies you create in 3rd party apps like Protege, work seamlessly with Stardog Designer and Explorer. However it’s benficial to follow a few key modelling practices.

First, avoid using owl:Restriction constructs to define properties. Instead, define your properties explicitly using OWL's built-in property types, with specified domains and ranges.

For data properties, use owl:DatatypeProperty. Each data property should have its domain set to the class it belongs to (the source class), and its range set to the appropriate datatype such as xsd:string, xsd:float, xsd:boolean.

Similarly, for object properties, use owl:ObjectProperty. The domain should be the source class (where the relationship originates), and the range should be the target class (where the relationship points to).

When properties are defined as above, Explorer can visualise the Model correctly. Explorer Query Builder will list only the relevant ObjectProperties and DatatypeProperties for the selected class. This significantly speeds up query building in a busy model and minimises errors.

Tip: To correctly browse and query instance data.

It's preferable not to have any instance data (ABox) in your model (TBox). They should be kept separate. However, if you do have a model that contains ABox data it is easy to write a SPARQL UPDATE query to extract those triples and move them to a separate named graph.
If your modelling tool is not named graph aware (eg Protege), you can create a separate ā€˜model’ for your TBox (model) and ABox (instance data). Then when you load them into Stardog, load them to separate named graphs. This will eliminate the need to move your instance data to a separate named graph.

Tip: Converting a model to one optimised for Explorer

If you import a model into Designer, only triples in the model that can be maintained with Designer or used by Explorer will be imported. For example, instance data triples or properties using owl:Restriction will not be imported. Therefore, if you then publish the model using Designer to a new named graph, you will have a model that is optimised for Designer and Explorer use. This does not remove the original model.

In addition, by default, rdfs:domain and rdfs:range will be rewritten as so:domainIncludes and so:rangeIncludes (schema.org). This is usually preferable and these changes will go unnoticed. However you can change this behaviour in Designer -> Settings -> Customize advanced project details and set Infer class types based on shared properties to Yes

Language tags from string literals in the model will be removed.

Good morning Joe,

thank you so much, this is the kind of roadmap I was looking for!

Regards,
Dick

2 Likes

Also, useful for me as well thanks. Just a suggestion and it could be that the tutorial someone pointed us to already covers this (I have a lot of deadlines and haven't had a chance to look at that yet) but a lot of people in the ontology community use Protege, especially people who are just starting out with the concept of Semantic Knowledge Graphs. I do a fair amount of training and I always encourage people to also use the community versions of technologies such as Stardog because Protege is great but it is a modeling tool not a database and you need a database and access to clients for Java and Python to really build systems rather than just models. Also, the visualization tools in Stardog, blow the visualization tools in Protege (OntoGraph and OWLViz) out of the water, just no comparison. It used to be the case that you could just take a Protege ontology, upload it into Stardog and it would work. I understand and agree with the reasons for the change, e.g., it is a best practice to put TBox and ABox data in different graphs. But IMO, it would be great to have a specific tutorial that people can easily find that explicitly covers "This is the easiest way to take an ontology from Protege and load it into Stardog". Just a thought.

Cheers,
Michael
https://www.michaeldebellis.com/blog