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

About special predicates #10

Closed
yhshu opened this issue Sep 1, 2021 · 2 comments
Closed

About special predicates #10

yhshu opened this issue Sep 1, 2021 · 2 comments

Comments

@yhshu
Copy link

yhshu commented Sep 1, 2021

Hi there,
special tokens such as

    PRED_INSTANCE = 'pred:instance_of'
    PRED_NAME = 'pred:name'

    PRED_VALUE = 'pred:value'  # link packed value node to its literal value
    PRED_UNIT = 'pred:unit'  # link packed value node to its unit

    PRED_YEAR = 'pred:year'  # link packed value node to its year value, which is an integer
    PRED_DATE = 'pred:date'  # link packed value node to its date value, which is a date

    PRED_FACT_H = 'pred:fact_h'  # link qualifier node to its head
    PRED_FACT_R = 'pred:fact_r'
    PRED_FACT_T = 'pred:fact_t'

It seems that these tokens are not supported by official Wikidata query service . Is there any document explains about how these tokens work?

@ShulinCao
Copy link
Collaborator

They are used to build our SPARQL engine. To denote qualifiers, we create a virtual node for those literal and relational triples. For example, to denote the start time of (Kobe Bryant, spouse, Vanessa Laine Bryant), we create a node _BN which connects to the subject, the predicate, and the object with three special edges, and then add (_BN, start time, 2001) into the graph. Similarly, we use virtual node to represent the attribute value of number type, which has an extra unit. For example, to represent the height of Yao Ming, we need (Yao Ming, height, _BN), (_BN, value, 229), (_BN, unit, centimetre).

@yhshu
Copy link
Author

yhshu commented Sep 6, 2021

Thanks for your reply.

@yhshu yhshu closed this as completed Sep 6, 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

2 participants