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

Is it possible to search for properties? #18

Open
marcelomachado opened this issue Dec 17, 2024 · 1 comment
Open

Is it possible to search for properties? #18

marcelomachado opened this issue Dec 17, 2024 · 1 comment

Comments

@marcelomachado
Copy link

Let's say I would like to perform a lookup search to find the property areaTotal (https://dbpedia.org/ontology/areaTotal), is there any way to use this tool with this purpose?

@JJ-Author
Copy link
Contributor

JJ-Author commented Dec 20, 2024

sure.
this is a very simple example config that indexes everything that has an English label from the dbpedia ontology.
fdfa975

but you can also build more advance keyword-based term searches with lookup
see a prototype here http://tools.dbpedia.org:8765/

but there is also a new project (still experimental) that uses a semantic search with vector embeddings
https://github.com/dbpedia/archivo-term-search-POTS independent of lookup instead using weaviate

the keyword prototype uses the following fields and that would allow e.g. to filter for Object or Datatypeproperties on the field type (not realized by the UI but would be possible with the lookup API)

     - fieldName: label
      resourceName: term
      query: >
        SELECT DISTINCT ?term ?label  WHERE {
          ?term <http://www.w3.org/2000/01/rdf-schema#label> | <http://www.w3.org/2004/02/skos/core#prefLabel> | <http://purl.org/dc/elements/1.1/title> | <http://purl.org/dc/terms/title> ?label .
          FILTER (lang(?label)="en" || lang(?label)="de" || lang(?label)="")
        }
    - fieldName: definition
      resourceName: term
      query: >
        SELECT DISTINCT ?term ?definition WHERE {
          ?term <http://purl.obolibrary.org/obo/IAO_0000115> ?definition .
        }
    - fieldName: type
      resourceName: term
      query: >
        SELECT DISTINCT ?term ?type WHERE {
          ?term <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type .
        }
      fieldType: string
    - fieldName: comment
      resourceName: term
      query: >
        SELECT DISTINCT ?term ?comment WHERE {
          ?term <http://www.w3.org/2000/01/rdf-schema#comment> ?comment .
        }
    - fieldName: altLabel
      resourceName: term
      query: >
        SELECT DISTINCT ?term ?altLabel WHERE {
          ?term <http://www.w3.org/2004/02/skos/core#altLabel> | <http://purl.obolibrary.org/obo/IAO_0000118> ?altLabel .
        }
    - fieldName: description
      resourceName: term
      query: >
        SELECT DISTINCT ?term ?description
        WHERE {
          ?term <http://purl.org/dc/elements/1.1/description> | <http://purl.org/dc/terms/description> | <http://purl.org/dc/terms/abstract> ?description .
        }

and the following search

- fieldName: label
      weight: 8.0
      highlight: true
      queryByDefault: true
    - fieldName: altLabel
      weight: 6.0
      highlight: true
      queryByDefault: true
    - fieldName: definition
      weight: 1.0
      highlight: true
      queryByDefault: true
    - fieldName: description
      weight: 0.9
      highlight: true
      queryByDefault: true
    - fieldName: comment
      weight: 0.8
      highlight: true
      queryByDefault: true
    - fieldName: type
      weight: 20
      highlight: false
      queryByDefault: false
      exact: true
      tokenize: false

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

2 participants