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

pyRDF2Vec with openalex dataset #171

Open
Weiweihere opened this issue Jan 17, 2023 · 3 comments
Open

pyRDF2Vec with openalex dataset #171

Weiweihere opened this issue Jan 17, 2023 · 3 comments
Labels
question Further information is requested

Comments

@Weiweihere
Copy link

❓ Question

I would like to ask if there are any restrictions for endpoint? I tried to use openalex without success.

I want to use this sparql end point ,so coding:

kg_sem = KG("http://semopenalex.org/sparql")

ValueError: 'location' must be a valid URL (got http://semopenalex.org/sparql)

@Weiweihere Weiweihere added the question Further information is requested label Jan 17, 2023
@bsteenwi
Copy link
Collaborator

Hi,

In my browser http://semopenalex.org/sparql is not a valid URL either...
Do you get the same error when using https://semopenalex.org/sparql (so the https version)?

@Weiweihere
Copy link
Author

Hi,

Thanks for your reminding! i have another question regarding how to define the literals?

I tried to according to example below, but then i am not sure how to set the content in literals[]. Could you give some explain? or the corresponding SPARQL Query of example.

KG(
"https://dbpedia.org/sparql",
skip_predicates={"www.w3.org/1999/02/22-rdf-syntax-ns#type"},
literals=[
[
"http://dbpedia.org/ontology/wikiPageWikiLink",
"http://www.w3.org/2004/02/skos/core#prefLabel",
],
["http://dbpedia.org/ontology/humanDevelopmentIndex"],
],

@bsteenwi
Copy link
Collaborator

bsteenwi commented Feb 1, 2023

Literal information can be provided by specifying the predicate(s) where the literal information from a given starting node of interest can be found.

The example above was defined for the countries dataset & we wanted to create an embedding for multiple countries (nodes of interest).

We specified that pyRDF2Vec can find numerical literal information for these countries in the first neighbourhood:

["http://dbpedia.org/ontology/humanDevelopmentIndex"] 

and in the second neighbourhood:

[
"http://dbpedia.org/ontology/wikiPageWikiLink",
"http://www.w3.org/2004/02/skos/core#prefLabel",
] 

For an example country http://dbpedia.org/resource/Antigua_and_Barbuda, you will find numerical information starting from this node http://dbpedia.org/resource/Antigua_and_Barbuda along the http://dbpedia.org/ontology/humanDevelopmentIndex path and also along the http://dbpedia.org/ontology/wikiPageWikiLink (intermediate node) http://www.w3.org/2004/02/skos/core#prefLabel path.

pyRDF2Vec only requires all the predicates along a path to literal information to take them into account.

I hope this explanation helps you to construct an example yourself.

Kind regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants