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

Ajouter un paramètre pour contrôler le prédicat utilisé pour les types dans les requêtes (rdf:type / wdt:p31 pour Wikidata) #72

Closed
tfrancart opened this issue Feb 13, 2019 · 10 comments
Labels
kind: Enhancement 📈 New feature or request status: Fixed ✔️ Done / to be validated

Comments

@tfrancart
Copy link
Contributor

Wikidata (https://query.wikidata.org) n'utilise pas rdf:type pour déclarer l'information de type, mais un prédicat spécial, wdt:p31 (full URI <http://www.wikidata.org/prop/direct/P31>).

Il faut ajouter une option de config "typePredicate" pour contrôler l'identifiant utilisé pour construire les queries. Par défaut cela doit rester "rdf:type", mais on veut pouvoir l'overwriter avec la valeur 'http://www.wikidata.org/prop/direct/P31'.

@tfrancart
Copy link
Contributor Author

Plus précisément, on va vouloir passer "wdt:P31/wdt:P279*"

@lubianat
Copy link

@tfrancart hello! I've been trying to use type predicate to get the "http://www.wikidata.org/prop/direct/P279*" behaviour, but I could not find a way of implementing that in native Sparnatural.

If I set something like

        addDistinct: true,
        typePredicate: "http://www.wikidata.org/prop/direct/P279*",
        sendQueryOnFirstClassSelected: false,

The system will render <http://www.wikidata.org/prop/direct/P279*> instead of <http://www.wikidata.org/prop/direct/P279>*.

Any ideas on how to make it work? Thanks!!

@SteinerPascal
Copy link
Collaborator

Hi @lubianat, are you using version <8? I just noticed that this feature is missing in version >8. I can have a look at it

@lubianat
Copy link

I am not sure which version I am using, this is the repo: https://github.com/lubianat/cell_ontology_sparql

(I tried to find out which version, but could not find it)

@SteinerPascal
Copy link
Collaborator

Yes you are using the old version. I have a fix for the sparql property path (*) already but I will investigate more on how to cover the others as well (https://www.w3.org/TR/sparql11-query/#propertypaths).
But interesting question you raised here

@tfrancart
Copy link
Contributor Author

tfrancart commented Jan 18, 2023 via email

@tfrancart
Copy link
Contributor Author

tfrancart commented Jan 18, 2023 via email

@SteinerPascal
Copy link
Collaborator

@tfrancart have you tested it? doesn't seem to work for me on main branch... also I can not see where it is integrated into the sparqlgenerator...

@tfrancart
Copy link
Contributor Author

tfrancart commented Jan 22, 2023

Ho yes, there is something wrong here. The parameter is passed down to RdfJsGenerator at https://github.com/sparna-git/Sparnatural/blob/master/src/sparnatural/generators/SparqlSelectBuilder.ts#L31, but never used. I will open a new issue.
And probably yes, using a property path here might not work now...

@SteinerPascal
Copy link
Collaborator

@lubianat As you can see i have a solution for any kind of property path for the type predicates. It should be merged into the main branch anytime soon.

tfrancart added a commit that referenced this issue Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: Enhancement 📈 New feature or request status: Fixed ✔️ Done / to be validated
Projects
None yet
Development

No branches or pull requests

4 participants