-
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
feature (webapi): make project shortcode required #824
Conversation
…tter. # Conflicts: # webapi/src/main/scala/org/knora/webapi/responders/v2/OntologyResponderV2.scala
@benjamingeer so this is more work then I anticipated. I'm not sure if I have broken something or if simply the expected result needs to be changed. Test output of
In particular, |
|
Never mind, I just saw that it does include them. :) |
thanks :-) |
# Conflicts: # webapi/src/test/scala/org/knora/webapi/responders/v2/OntologyResponderV2Spec.scala
@benjamingeer whenever you have some spare time :-) |
} else { | ||
s"http://$IriDomain/${projectInfo.shortname}/$knoraResourceID" | ||
} | ||
s"http://$IriDomain/${projectInfo.shortcode}/${projectInfo.shortname}/$knoraResourceID" |
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.
Why include both the project shortcode and the project shortname?
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.
Good catch. Only the shortcode would be more than enough.
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.
done
|
||
<http://data.knora.org/0C-0L1kORryKzJAJxxRyRQ> a anything:Thing ; | ||
<http://rdfh.ch/0C-0L1kORryKzJAJxxRyRQ> a anything:Thing ; |
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 you really want to make this standard, it would have to include the project shortcode as in KnoraIdUtil.makeRandomResourceIri
.
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.
yes, you are right.
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 we have:
- lists: `http://rdfh.ch/lists/0001/xxxx
- users: `http://rdfh.ch/users/xxxxxxx
- projects: `http://rdfh.ch/projects/0001
shouldn't we have for resources: http://rdfh.ch/resources/0001/xxx`?
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.
but this is another discussion. I will do it as described here
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.
That is how we formatted our data too, so, so far, our prod data is compliant to the doc.
But our (Lausanne) next upgrade will be a big one, so I would be in favour to push as much changes as we want to push now and have smoother releases in the future.
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.
done
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 want to do this for incunabula-data.ttl
, too?
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.
Oh, please no. This will take too long. The anything data is small, while incunabula is huge. I need to finish some things for Lukas before my vacation next week and after I'm back, prepare the production server, so I won't be working on Knora until June.
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.
No problem, I was just wondering how masochistic you were feeling. :)
@@ -413,7 +416,7 @@ Die Internetpublikation macht das digitalisierte Korpus dieser Frühdrucke durc | |||
# BEOL # | |||
################################### | |||
|
|||
<http://rdfh.ch/projects/0801> a knora-base:knoraProject ; | |||
<http://rdfh.ch/projects/yTerZGyxjZVqFMNNKXCDPF> a knora-base:knoraProject ; |
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.
Why does the BEOL project have a UUID in its IRI, while all the other projects have shortcodes in their IRIs?
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.
Because then I would also need to change the data on the production server, which I'm reluctant to do at the moment.
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, no problem.
@@ -1779,7 +1781,7 @@ class StringFormatter private(val knoraApiHostAndPort: Option[String]) { | |||
*/ | |||
def xmlImportNamespaceToInternalOntologyIriV1(namespace: String, errorFun: => Nothing): SmartIri = { | |||
namespace match { | |||
case ProjectSpecificXmlImportNamespaceRegex(_, Optional(projectCode), ontologyName) if !isBuiltInOntologyName(ontologyName) => | |||
case ProjectSpecificXmlImportNamespaceRegex(projectCode, ontologyName) if !isBuiltInOntologyName(ontologyName) => |
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.
Sorry, this was my bug here, fixed now.
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.
thanks :-)
These were both my mistakes, sorry: The code that uses the regex that matches project-specific API v1 XML import namespaces was incorrect (it expected the wrong number of capturing groups). I've fixed that, and made the project shortcode required in the regex again, and it works now. The regex that matches API v2 ontology URL paths was incorrect because it can't require the shortcode (which I mistakenly made it do), because it handles built-in ontologies as well as project-specific ones, and built-in ontologies don't have shortcodes. Thanks for the tests. :) |
Thanks for adding the fix :-) |
This was really a lot of work, thanks for being patient enough to do it. |
thanks :-) |
* develop: feature (webapi): make project shortcode required (#824) doc (webapi): jekyll / paradox based documentation website (#751) Validate ontologies loaded from the triplestore (#806) fix (webapi): add searchbox gui element to hasOtherSomething property (#828) feature (webapi): allow loading data into graphdb on windows (internal PR) (#814) build (webapi): add missing library (#822) feature (webapi): allow changing of user’s password by system admin (#815) feature (webapi): OpenAPI / Swagger API documentation generation (#812)
* develop: feature (webapi): make project shortcode required (#824) doc (webapi): jekyll / paradox based documentation website (#751) Validate ontologies loaded from the triplestore (#806) fix (webapi): add searchbox gui element to hasOtherSomething property (#828) feature (webapi): allow loading data into graphdb on windows (internal PR) (#814) build (webapi): add missing library (#822) feature (webapi): allow changing of user’s password by system admin (#815) feature (webapi): OpenAPI / Swagger API documentation generation (#812)
Summary
incunabula
,biblio
andanything
)dokubib
shortcode to one from the production range as these projects are going to be added in productiondata.knora.org
tordfh.ch
Issues