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

Build author-disambiguator link from aliases #608

Open
fnielsen opened this Issue Jan 5, 2019 · 2 comments

Comments

2 participants
@fnielsen
Copy link
Owner

fnielsen commented Jan 5, 2019

Question here: https://stackoverflow.com/questions/53933564

SELECT
  (COUNT(?work) AS ?count) 
  ?author_name
  (CONCAT(
      'https://tools.wmflabs.org/author-disambiguator/?doit=Look+for+author&name=',
      ENCODE_FOR_URI(?author_name)) AS ?author_disambiguator)
WHERE {
  {
    SELECT DISTINCT ?author_name {
      wd:Q7082930 skos:altLabel ?author_name_ .
      
      # The SELECT-DISTINCT-BIND trick here is due to Stanislav Kralin
      # https://stackoverflow.com/questions/53933564
      BIND (STR(?author_name_) AS ?author_name)
    }
  }
  OPTIONAL { ?work wdt:P2093 ?author_name . }
}
GROUP BY ?author_name 
ORDER BY DESC(?count)
@Daniel-Mietchen

This comment has been minimized.

Copy link
Collaborator

Daniel-Mietchen commented Jan 10, 2019

Depending on performance, this could be combined with strings that appear as P1932 ("stated as") values in P50 (author) statements, as per Daniel-Mietchen/ideas#488 and arthurpsmith/author-disambiguator#26 .

Note that the author disambiguator allows some additional filtering, as per arthurpsmith/author-disambiguator#17 .

@Daniel-Mietchen Daniel-Mietchen added this to To do in Missing via automation Jan 16, 2019

@Daniel-Mietchen Daniel-Mietchen added this to To do in Authors via automation Jan 16, 2019

@Daniel-Mietchen

This comment has been minimized.

Copy link
Collaborator

Daniel-Mietchen commented Feb 21, 2019

Here is a variant of that query that uses "stated as" too:

PREFIX target: <http://www.wikidata.org/entity/Q6251482>

SELECT
  (COUNT(?work) AS ?count) 
  ?author_name
  (CONCAT(
      'https://tools.wmflabs.org/author-disambiguator/?doit=Look+for+author&name=',
      ENCODE_FOR_URI(?author_name)) AS ?author_resolver_url)
WHERE {
  {
    SELECT DISTINCT ?author_name {
      {
      { target: skos:altLabel ?author_name_ } UNION { target: rdfs:label ?author_name_ }.
      
      # The SELECT-DISTINCT-BIND trick here is due to Stanislav Kralin
      # https://stackoverflow.com/questions/53933564
      BIND (STR(?author_name_) AS ?author_name) }
      UNION
      { 
        ?author_statement ps:P50 target: .
        ?author_statement pq:P1932 ?author_name.
      }
    }
  }
  OPTIONAL { ?work wdt:P2093 ?author_name . }
}
GROUP BY ?author_name 
ORDER BY DESC(?count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment