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

Admin API #553

Open
29 of 33 tasks
subotic opened this issue Jun 27, 2017 · 9 comments
Open
29 of 33 tasks

Admin API #553

subotic opened this issue Jun 27, 2017 · 9 comments
Assignees

Comments

@subotic
Copy link
Collaborator

subotic commented Jun 27, 2017

The following list will provide an easier overview of what is implemented and what is still missing. Also, it provides the information if the feature is already available in develop or implemented in a PR (which would require using a specific branch).

User

  • Get all users
  • Get single user
  • Change basic user information (name, password, etc.)
  • Add user to project
  • Change user SystemAdmin status

Projects

  • Get all projects
  • Get single project (by IRI and by Shortname)
  • Get project members
  • Create project
  • Change basic project information
  • Return lists of OntologyV1 and OntologyV2 objects for each project, keeping the admin API version independent.

Groups

  • Get all groups (develop)
  • Get single group (by IRI and by ProjectIri and Shortname)
  • Get group members
  • Create group (develop)
  • Change basic group information

Keywords

  • Get all keywords

Permissions

  • Get DOA permissions
  • Get administrative permissions
  • Create DOA permissions
  • Change DOA permissions
  • Create administrative permissions
  • Change administrative permissions

Lists

@subotic subotic added enhancement improve existing code or new feature in-progress labels Jun 27, 2017
@subotic subotic added this to the On Deck milestone Jun 27, 2017
@subotic subotic self-assigned this Jun 27, 2017
@subotic
Copy link
Collaborator Author

subotic commented Jul 17, 2017

do-not-edit-start-codetree-epic-issues

Issues in this epic:

Title Milestone Assignees Stage State
Reposition list item #1388 2020-02 LukasStoeckli, subotic stage/backlog Open
do-not-edit-end-codetree-epic-issues

Depends on: #486

@subotic
Copy link
Collaborator Author

subotic commented Jul 17, 2017

Depends on: #572

@subotic subotic modified the milestones: On Deck, Backlog Jun 29, 2018
@kilchenmann
Copy link
Contributor

kilchenmann commented Sep 5, 2018

I get wrong ontology iris in the ProjectResponse.
For example: I make a project info request for incunabula
http://0.0.0.0:3333/admin/projects/http%3A%2F%2Frdfh.ch%2Fprojects%2F0803 and I get an array of ontologies:
["http://www.knora.org/ontology/0803/incunabula"]

But when I want to use this IRI to get the ontology information (e.g. /allentities)
http://0.0.0.0:3333/v2/ontologies/allentities/http%3A%2F%2Fwww.knora.org%2Fontology%2F0803%2Fincunabula

I get the following response:

{
    "error": "org.knora.webapi.BadRequestException: Invalid ontology IRI: http://www.knora.org/ontology/0803/incunabula"
}

The ontology IRI in this project should be http://0.0.0.0:3333/ontology/0803/incunabula/v2

So, how should we fix this?

@benjamingeer
Copy link

The admin API uses internal IRIs (the ones used in the triplestore) rather than API v2's external IRIs. Not sure of the best way to deal with this.

@kilchenmann
Copy link
Contributor

I'm sure @subotic has a solution.

Otherwise I have to make two requests (and the ontology IRIs in project object are useless):

  1. /v2/ontologies/metadata to get the ontology IRIs
  2. /v2/ontologies/allentities

@subotic
Copy link
Collaborator Author

subotic commented Sep 5, 2018

I see two possibilities:

  • you transform them to V2 in the GUI
  • I transform them to V2 in the API

What happens when we have V3, V4, etc. ontology IRIs? What should the admin API return then?

It would be a small function in the GUI to transform an internal ontology IRI to an external V2 ontology IRI: replace www.knora.org with host:port and append /v2.

@benjamingeer
Copy link

replace www.knora.org with host:port and append /v2.

That only works for project-specific ontologies. For a built-in Knora ontology, the external hostname is always api.knora.org. Also, the external name of the knora-base ontology is knora-api.

Seems error-prone to have this knowledge in more than one place. I don’t see the harm in doing two requests as @kilchenmann said, especially since the GUI caches ontologies.

@subotic
Copy link
Collaborator Author

subotic commented Sep 6, 2018

Does it maybe make sense to return in the admin API both, the internal and external ontology IRIs?

Or when requesting the project info, tell the API that you would like to have internal or external v2 /v3 /vx ontology IRIs.

Anyhow, this will take a moment to implement. So the fastest way, for now, would be to make a second request, as @benjamingeer suggested.

@benjamingeer
Copy link

Does it maybe make sense to return in the admin API both, the internal and external ontology IRIs?

Or when requesting the project info, tell the API that you would like to have internal or external v2 /v3 /vx ontology IRIs.

Either would be easy to do. To get an IRI in any schema you like, you just have to do something like iri.toSmartIri.toOntologySchema(ApiV2WithValueObjects).

@subotic subotic removed this from the Backlog milestone Aug 6, 2019
@subotic subotic added codetree-epic and removed enhancement improve existing code or new feature in-progress labels Aug 13, 2019
@subotic subotic added this to the 2019-10 milestone Aug 13, 2019
@subotic subotic changed the title Admin API Progress Admin API Aug 13, 2019
@subotic subotic modified the milestones: 2019-10, 2019-11 Oct 27, 2019
@subotic subotic modified the milestones: 2019-11, 2019-12 Nov 27, 2019
@benjamingeer benjamingeer removed this from the 2019-12 milestone Dec 16, 2019
@benjamingeer benjamingeer added this to the 2020-01 milestone Dec 16, 2019
@benjamingeer benjamingeer modified the milestones: 2020-01, 2020-02 Jan 27, 2020
@subotic subotic modified the milestones: 2020-02, 2020-01 Feb 7, 2020
@irinaschubert irinaschubert removed this from the 2020.1 milestone Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants