-1

I'm really getting mad with this! I nead to create a query for a graph, using rdf lib. This is the query:

queryCompetence = """prefix context: <http://www.ontologydesignpatterns.org/ont/mine/context.owl#>
                            select ?score where { <""" + \
                            str(elem) + """> context.hasProperty ?MyProperty. ?MyProperty ttt:hasScore ?score}."""

Where elem is a URI. I get the error: "ParseException: Expected "}" (at char 129), (line:2, col:51)", corresponding to the beginning of the elem URI in the query. Can anyone help me?

Alex
  • 149
  • 1
  • 6
  • 1
    Need to have more of your code to recreate your problem. Please post everything, including your imports, the version of rdflib, python version etc. – William Denman Nov 18 '13 at 12:27
  • Thank you @William :-) But i have just tried this solution and it didn't work. The problem was the "context.hasProperty" that should became "context:hasProperty" – Alex Nov 18 '13 at 13:27
  • 1
    Great! Glad you got it to work. However, the way you asked your question, there was no way anyone could take your code and paste it immediately into the Python interpreter and reproduce your error. You need to include everything that I mentioned above. If you do in the future, the chances that it will be upvoted will increase. – William Denman Nov 18 '13 at 13:39
  • This question appears to be off-topic because it is about a simple typo in the query (`.` instead of `:`). – Joshua Taylor Nov 18 '13 at 15:39

1 Answers1

2

The author of this post has found the answer. The problem was that the context.hasProperty should be context:hasProperty

William Denman
  • 3,046
  • 32
  • 34