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

Unable to query the rdf:type #231

Open
Gautamshahi opened this issue Oct 5, 2023 · 3 comments
Open

Unable to query the rdf:type #231

Gautamshahi opened this issue Oct 5, 2023 · 3 comments

Comments

@Gautamshahi
Copy link

I am trying to get the wordnet type for each yago entity but getting the error as

query looks like

q = """
SELECT ?object
WHERE {
http://yago-knowledge.org/resource/Jean-Baptiste-Joseph_Gobel rdf:type ?object
}
"""

error=

self.BadSyntax(argstr, i, 'Prefix "%s:" not bound' % (pfx))
File "/Users/admin/PycharmProjects/Uni_Caen_GYREC/venv/lib/python3.7/site-packages/rdflib/plugins/parsers/notation3.py", line 1730, in BadSyntax
raise BadSyntax(self._thisDoc, self.lines, argstr, i, msg)
rdflib.plugins.parsers.notation3.BadSyntax: at line 1 of <>:
Bad syntax (Prefix "rdf:" not bound) at ^ in:
"b'<1908_St._Louis_Browns_season>\t'^b'rdf:type\t<wordnet_abstraction_100002137> .\n<1908_St._Louis_B'..."

How to solve the issue?

@roelj
Copy link

roelj commented Oct 23, 2023

Perhaps try to include the prefix for rdf:

q = """PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?object
WHERE {
<http://yago-knowledge.org/resource/Jean-Baptiste-Joseph_Gobel> rdf:type ?object
}
"""

@Gautamshahi
Copy link
Author

Thank you. Upon time, I have fixed the issue, but how do I parse a large triples file in RDFLIB or is there any alternative for it?

@ThomasThelen
Copy link

Thank you. Upon time, I have fixed the issue, but how do I parse a large triples file in RDFLIB or is there any alternative for it?

Scale your machine so that it can handle your dataset in memory, use a formal graph database, etc.

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

3 participants