2

I have this structure hosted on parse.com:

Event

  • objectId: String
  • playerId: Pointer<Player>
  • matchId: Pointer<Match>
  • some other properties not relevant to the question

Match

  • objectId: String
  • ownerId: String
  • matchDate: Date

I want to retrieve all events related to one specific Match using REST, but there is something wrong with the query I'm using.

This is the query I'm using (ruby with HTTParty gem):

base_uri = "https://api.parse.com/1/classes"
endpoint = 'Event/?&include=matchId&where={"ownerId":"201"}'
app_id = "app_id"
rest_api_key = "api_key"
headers = {"X-Parse-Application-Id" => app_id, 
    "X-Parse-REST-API-Key" => rest_api_key, 
    "Content-Type" => "application/json"}

response = HTTParty.get(URI.encode("#{base_uri}/#{endpoint}"), headers: headers)
1
  • Afaik. currently there is no standard way or even recommendation to describe queries. There are non-standard solutions like the one you found, or e.g. github.com/persvr/rql . The only general standard solution I know of, is describing a query param with JSON-LD, hydra and URI templates and put SPARQL into that param. Afaik there is no RDF vocab, which can describe queries. Maybe I'll make one, but I won't have time to do this for months. Commented Jan 19, 2015 at 7:49

1 Answer 1

5

Turns out that it's done the same way as relational queries. Here is the working query:

endpoint = 'Event/?where={"matchId":{"$inQuery":{"where":{"ownerId":201},"className":"Match"}}}'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.