dasch-swiss / beol

Bernoulli-Euler OnLine
https://beol.dasch.swiss
GNU Affero General Public License v3.0
0 stars 1 forks source link

route for person with GND or VIAF #152

Closed SepidehAlassi closed 4 years ago

SepidehAlassi commented 5 years ago

a route to retrieve a person with its GND or VIAF number

SepidehAlassi commented 5 years ago

@tobiasschweizer can you please review this?

SepidehAlassi commented 5 years ago

@tobiasschweizer I have not yet completed the requested changes of your last review, I will do so today and notify you to check the changes.

tobiasschweizer commented 5 years ago

I have not yet completed the requested changes of your last review, I will do so today and notify you to check the changes.

Sorry, I was too fast then. Thanks for keeping me up to date.

SepidehAlassi commented 5 years ago

@tobiasschweizer instead of forcing the user to follow a specific pattern, I believe it is better to support SPARQL CONTAINS and SPARQL STARTSTR in gravsearch and then use them in the filter as FILTER ( STRSTARTS(?personGndNumber, "(DE-588)"^^http://www.w3.org/2001/XMLSchema#string) && ?personGndNumber = "(DE-588)${param}"^^http://www.w3.org/2001/XMLSchema#string || STRSTARTS(?personGndNumber, "(VIAF)"^^http://www.w3.org/2001/XMLSchema#string) && ?personGndNumber = "(VIAF)${param}"^^http://www.w3.org/2001/XMLSchema#string) then there won't be any collision at all.

This can be done later, I don't think anybody till then might run into collisions.

tobiasschweizer commented 5 years ago

@SepidehAlassi Sorry, I don't understand.

Isn't the problem we have that we simply cannot pass the parentheses contained in the prefix to the component using the route? But the user actually knows the prefix. So we just need to find a way to instruct the component whether it is a GND or VIAF before doing the query. Then no logical OR would be needed in the filter.

So the logic would work as follows:

  1. decide what the prefix is
  2. get the id without prefix from the route
  3. do a Gravsearch query with the complete identifier

Maybe 1. could be done by adding an additional parameter.

The config could look like this:

{
        path: 'personsearch/:prefix/:gnd',
        component: PersonRouteComponent
    },

and the in the component you would get:

ParamsAsMap {params: {…}} keys: (...) params: {prefix: "gnd", gnd: "118560565"}

Then the full identifier is simply a combination of the params prefix and gnd.

SepidehAlassi commented 5 years ago
  • decide what the prefix is
  • get the id without prefix from the route
  • do a Gravsearch query with the complete identifier

We have discussed this suggestions of yours before. It requires the user to provide a prefix without parentheses. However, my suggestion with a check of the start of the string for every gnd number eliminates the need for a prefix.

the above if-else is the expression inside the filter command of gravsearch which I have given in the previous comment

As you see in this way, there will not be any need for a prefix given by the user, and no collision might occur.