Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classtree/Property tree for navigation #418

Open
situx opened this issue Aug 1, 2020 · 8 comments
Open

Classtree/Property tree for navigation #418

situx opened this issue Aug 1, 2020 · 8 comments
Milestone

Comments

@situx
Copy link

situx commented Aug 1, 2020

We used Widoco in one of our research projects for documentation and are now in the process of giving those ontologies to additional domain experts who are not proficient in RDF for verification purposes.

We found that a (Protegé-like) classtree and a property tree help in this verification process so we extracted such trees from the Widoco documentation in this project:

https://github.com/situx/widoco_classtree

Example page here:

https://situx.github.io/widoco_classtree/

Even though the version we created works, I think native support by Widoco to generate such trees for better navigation could be a nice addition to the project.

What do you think?

@rpietzsch
Copy link
Contributor

👍 Looks very useful to me. Would love to see this in widoco. Thx for sharing!

@dgarijo
Copy link
Owner

dgarijo commented Aug 1, 2020

I agree, this would be a nice addition. I will explore how to incorporate it. I think that it would be nice to have the search menu as a collapsable menu on the doc; maybe that way one could search but also read the full documentation.

Thanks a lot for sharing. I am not sure when I will have time to incorporate this but it's definitely something very useful!

@situx
Copy link
Author

situx commented Aug 1, 2020

I agree. Initially it was also our plan to make the menu collapsible. Maybe we could add this to our project if it helps you.

Considering if you want to reuse our approach:

We used the jstree library (https://www.jstree.com) to generate the different trees which requires a JSONArray consisting of JSON objects as input incorporating class/superclass relations.

So basically if Widoco were to create a JSONArray with entries like these each for classes, objproperties, dataproperties, individuals:
{ "id" : "http://www.w3.org/2002/07/owl#MyClass", "icon" : "myicon.gif", "parent":"http://www.w3.org/2002/07/owl#MySuperClass", "text" : "MyClassLabel" }
JSTree could create a tree like we do on our homepage.
We currently achieve this by parsing the HTML page in JavaScript as shown in classtree.js
e.g. we look for a "class" entry and then add the first entry of "has super-classes" to our JSON object

@dgarijo
Copy link
Owner

dgarijo commented Aug 1, 2020

Yeah, generating the JSON would be definitely faster than having to parse the HTML. Probably I can generate it with the documentation from the HTML itself when everything is generated. Thanks!!
And if you want to add this functionality to Widoco, please feel free to do a pull request. Otherwise I will have a look when I have the chance :)

@situx
Copy link
Author

situx commented Aug 2, 2020

I could prepare a version of our homepage including collapsing which loads from JSON files and which you could include in your Widoco template. As for the generation of the JSON file I would need a hint where to start or where to implement it in the Widoco code. Right now I am a bit lost where to start.

@dgarijo
Copy link
Owner

dgarijo commented Aug 2, 2020

Right now the documentation is an i-frame. Instead, what I would do is to add a side menu on the documentation itself. For example, the way W3C does it in its newest template: https://www.w3.org/TR/vocab-ssn/ and adding the contents of the exploration bar you have done, which are very nice. It would help if the JSON is directly created from the HTML fragment, which happens in the https://github.com/dgarijo/Widoco/blob/master/src/main/java/widoco/CreateResources.java class (in particular, the createCrossReference method)

@situx
Copy link
Author

situx commented Aug 2, 2020

I tried to create the JSON in CreateResources.java but could not figure out how to access SubClass/SubProperty relations from there. I only found classnames/property names as Strings.

But I created a new version of our page:
https://situx.github.io/widoco_classtree/index2.html

This one loads already precreated JS files like these: https://github.com/situx/widoco_classtree/tree/master/js

Apart from the iframe, the remaining contents of the HTML page could be included in the documentation side menu as you state.
However, I am again lost how to do that in the generation process.

The treedata_generated.js is created using OWLAPI with the following class:
https://github.com/situx/widoco_classtree/blob/master/src/ClassTreeParser.java

I found that you use OWLAPI in Widoco, correct?
If so you might be able to include this class somehow into your generation workflow.

@dgarijo
Copy link
Owner

dgarijo commented Aug 3, 2020

Yes, I use the OWL API, so if it's easier, I can have a look at generating the JSON directly from the ontology. I will have a look when possible, thanks!

@dgarijo dgarijo added this to the v1.4.15 milestone Aug 6, 2020
@dgarijo dgarijo modified the milestones: v1.4.15, v1.5.0 Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants