-
Notifications
You must be signed in to change notification settings - Fork 18
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
Use salsah-gui:guiOrder in cardinalities instead of in property definitions #737
Conversation
This is a move highly appreciated, thanks for that! Would it make sense to move also the |
@musicEnfanthen I can see your point, but I think it is a bit less relevant than having the I would rather define once and for all that a |
If we support But putting more stuff in cardinalities is awkward with the current design in the ontology responder. If I do that, I'd like to do it later as part of #738. |
…tology. - Update drawings-gods_ontology.ttl.
…ons. - Still lots more inconsistent test data to fix.
…iAttributeDefinition. - Add more documentation. - Fix invalid GUI attributes in test ontologies and in knora-base. - Fix tests.
@subotic you can review whenever you like :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While reading the salsah-gui.rst
it seems to me that this ontology is very Salsah-V1 specific.
Wouldn't something like this :guiAttributeDefinition "hlist(required):iri"
be better broken down into individual properties?
@@ -443,7 +336,7 @@ Properties of Value | |||
A resource may have several properties of the same type with | |||
different values (which will be of the same class), and it may be | |||
necessary to indicate an order in which these values occur. For | |||
example, a book may have several authors which should appear in a | |||
example, a book may have several authors which should appear in af |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo at af
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
@@ -970,7 +863,7 @@ Knora's built-in support for “standoff” markup, which is stored | |||
separately from the text. This has some advantages over embedded markup | |||
such as XML. [#]_ While XML requires markup to have a hierarchical | |||
structure, and does not allow overlapping tags, standoff nodes do not | |||
have these limitations (Schmidt2016_). A standoff tag can be attached to | |||
have these limitations. [Schmidt2016]_ A standoff tag can be attached to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the link be before the period?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a footnote, so I just tried to format it like the other footnotes in that document. Apparently it was syntactically invalid before, but older versions of Sphinx never complained. When I upgraded Sphinx, it told me there was an error on that line. That's the only reason I changed it.
How so? Won't SALSAH 2 also use HTML elements for input?
What do you mean by individual properties? Can you give some examples? All I tried to do here was document and enforce the conventions that are already used in project-specific ontologies. Keep in mind that if we change those conventions, we also have to change all project-specific ontologies. |
I was just thinking out loud. Nothing that we should change now.
Something like this:
This would be somewhat safer, but would also require specifying a lot more properties in a lot more detail. Also, as you said, we would need to change a lot of existing data. This is probably to much. |
I agree, and I thought about this too, but I think it just isn't worth going to the trouble to change everyone's ontologies now. At least with this PR, the attributes are checked for validity. |
@@ -12,79 +12,93 @@ | |||
"rdfs:subClassOf" : [ "http://api.knora.org/ontology/knora-api/simple/v2#StillImageRepresentation", { | |||
"@type" : "owl:Restriction", | |||
"owl:cardinality" : 1, | |||
"owl:onProperty" : "http://0.0.0.0:3333/ontology/00FF/images/simple/v2#bearbeiter" | |||
"owl:onProperty" : "http://api.knora.org/ontology/knora-api/simple/v2#creationDate" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a general question, where is this URL defined? I didn't find it in application.conf
. I don't think that this a good idea, as this would mean, that we would need to have something running or serving at this address? Why not have it like this: `http://0.0.0.0:3333/ontology/knora-api/simple/v2#creationDate"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is documented here:
The idea is that we will have a Knora instance serving the built-in ontologies at that address.
If it was http://0.0.0.0:3333/ontology/knora-api/simple/v2#creationDate
, then the knora-api
ontology running on project-specific server A would not appear to be the same as the knora-api
ontology running on project-specific server B. From a client's point of view, they would not be the same ontology so would not be interoperable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be generally possible to "dump" the knora-api
ontologies to files? I'm thinking of an easy way to serve all our ontologies. If all the ontologies would be available as files, then it wouldn't be difficult to serve them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The knora-api
ontologies are already served by the Knora API server. You can request them from the API, download them, save them in files. That's what I did to make the test data for OntologyV2R2RSpec
. It uses these files:
- The
knora-api
v2 ontology in the simple schema: https://github.com/dhlab-basel/Knora/blob/develop/webapi/src/test/resources/test-data/ontologyR2RV2/knoraApiOntologySimple.json - The
knora-api
v2 ontology in the default schema: https://github.com/dhlab-basel/Knora/blob/develop/webapi/src/test/resources/test-data/ontologyR2RV2/knoraApiWithValueObjects.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the API server only serves ontologies in JSON-LD. What I've been planning to do is get the API server to take an HTTP Accept
header and then be able to convert the JSON-LD to Turtle, XML, or HTML.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the current design, we can't use www.knora.org
for external (API v2) ontologies, because it's reserved for internal ontologies (the ones used in the triplestore):
SmartIriImpl
uses the hostname to determine whether the IRI is internal or external.
We could redesign all this, but I'd really rather not. :)
Thanks for bearing with me :-)
No problem. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I don't think we should rely on GitHub to serve Knora ontologies. That would mean that if GitHub is down, the DaSCH is down. Also, my understanding is that as critical research infrastructure for Switzerland, the DaSCH is supposed to be hosted in Switzerland.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The less dependency there is on a running Knora stack
The DaSCH can't exist without a running Knora stack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could redesign all this, but I'd really rather not. :)
ok, we should then leave it as it is.
The less dependency there is on a running Knora stack
The DaSCH can't exist without a running Knora stack.
What I meant by this is, if our Knora stack is down for a few hours (which is acceptable by DaSCH's / Lukas's standard) then this shouldn't have a negative impact on all other running Knora instances around Switzerland / World because they all depend on our served ontologies.
That's why I would like to see a separation of the serving of ontologies from the Knora stack and implement the serving of instances in a lightweight and highly available (redundant) way. Nginx serving flat files is a much simpler and lightweight (read costs less) setup, then the whole Knora stack.
We will host the DaSCH Knora stack with Switch, but not completely in a high availability way. The data will have a redundancy of 6 with data in Zürich and Lausanne (losing data is not acceptable), but the machine running the stack will not be redundant (few hours of downtime acceptable).
I would love to have everything highly redundant so that we don't have a minute of downtime, but the budget constraints are what they are. Well, maybe someday this will change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK! I like flat files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you maybe run the Salsah Gui tests?
I would love to run the SALSAH GUI tests but for that I need a working Sipi. I seem to remember there was a nice Docker image for it, but I can't seem to find it now, is there some documentation I could use? |
I personally always go to
I should probably add this to the Knora documentation. |
for sipi, this is the relevant line:
|
Cool, thanks!
That would be great. :) |
Did you manage to get |
When I finish PR #742 it should be easy to run the whole stack. |
I ran out of time to try Sipi this week. Will try on Monday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the Salsah GUI tests pass, then please merge.
I fixed the SALSAH GUI tests by adding a half-second delay to the login method. :) |
@subotic thanks for the review! |
Overview:
salsah-gui:guiOrder
to cardinalities in class definitions, instead of attaching it to property definitions. This allows the same property to be first in one class and last in another class.salsah-gui:guiAttribute
.Tasks:
drawings-gods_ontology.ttl
) so they usesalsah-gui:guiOrder
on cardinalities rather than on properties.salsah-gui:guiOrder
in an existing ontology, and use it to updatedrawings-gods_ontology.ttl
, which is too large to update manually.salsah-gui:guiOrder
in cardinalities in class definitions returned by the API v2 ontology routes.salsah-gui:guiOrder
when updating cardinalities via API v2.salsah-gui:guiAttribute
andsalsah-gui:guiAttributeDefinition
as a DSL parsed byStringFormatter
, and use the attribute definitions to validate the attributes when loading ontologies from the triplestore.salsah-gui:guiAttribute
in test ontologies.salsah-gui
ontology (reorganising and updating the Knora ontology docs a bit) and the rest of the above.TODO in a subsequent pull request:
salsah-gui:guiElement
andsalsah-gui:guiAttribute
when serving ontologies in API v2.salsah-gui:guiElement
andsalsah-gui:guiAttribute
to be updated via API v2.Resolves #601.
Resolves #744.