{"action":"created","issue":{"url":"https://api.github.com/repos/jsonld-java/jsonld-java/issues/246","repository_url":"https://api.github.com/repos/jsonld-java/jsonld-java","labels_url":"https://api.github.com/repos/jsonld-java/jsonld-java/issues/246/labels{/name}","comments_url":"https://api.github.com/repos/jsonld-java/jsonld-java/issues/246/comments","events_url":"https://api.github.com/repos/jsonld-java/jsonld-java/issues/246/events","html_url":"https://github.com/jsonld-java/jsonld-java/issues/246","id":380953336,"node_id":"MDU6SXNzdWUzODA5NTMzMzY=","number":246,"title":"How do I query the parsed jsonld document for query keys?","user":{"login":"jeyendranbalakrishnan","id":9890347,"node_id":"MDQ6VXNlcjk4OTAzNDc=","avatar_url":"https://avatars2.githubusercontent.com/u/9890347?v=4","gravatar_id":"","url":"https://api.github.com/users/jeyendranbalakrishnan","html_url":"https://github.com/jeyendranbalakrishnan","followers_url":"https://api.github.com/users/jeyendranbalakrishnan/followers","following_url":"https://api.github.com/users/jeyendranbalakrishnan/following{/other_user}","gists_url":"https://api.github.com/users/jeyendranbalakrishnan/gists{/gist_id}","starred_url":"https://api.github.com/users/jeyendranbalakrishnan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeyendranbalakrishnan/subscriptions","organizations_url":"https://api.github.com/users/jeyendranbalakrishnan/orgs","repos_url":"https://api.github.com/users/jeyendranbalakrishnan/repos","events_url":"https://api.github.com/users/jeyendranbalakrishnan/events{/privacy}","received_events_url":"https://api.github.com/users/jeyendranbalakrishnan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-15T00:55:45Z","updated_at":"2018-11-17T07:44:53Z","closed_at":null,"author_association":"NONE","body":"I am able to successfully parse json-ld documents now, using jsonld-java.\r\nUsing the compact() API, I get back a Map<String, Object>, where the keys are string IRIs, basically prefixed by the context URI and suffixed by individual keys.\r\nI have two questions regarding how to query the parsed object to get specific data out:\r\n1. The values returned by the API for each map key in the returned Map<String, Object> is an arbitrary object. What is the best way to walk down the tree of starting from a known top level key? For instance, how do I know if a given value is a primitive (String, integer, double, date, etc) rather than a JSON object that needs to be queried using it's methods? And so down the tree at any level? \r\n2. If I used the API on arbitrary json-ld documents, which have their own contexts not known at coding time, how do I format the query keys with the unknown context prefix at query time?\r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/jsonld-java/jsonld-java/issues/comments/439596768","html_url":"https://github.com/jsonld-java/jsonld-java/issues/246#issuecomment-439596768","issue_url":"https://api.github.com/repos/jsonld-java/jsonld-java/issues/246","id":439596768,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTU5Njc2OA==","user":{"login":"jeyendranbalakrishnan","id":9890347,"node_id":"MDQ6VXNlcjk4OTAzNDc=","avatar_url":"https://avatars2.githubusercontent.com/u/9890347?v=4","gravatar_id":"","url":"https://api.github.com/users/jeyendranbalakrishnan","html_url":"https://github.com/jeyendranbalakrishnan","followers_url":"https://api.github.com/users/jeyendranbalakrishnan/followers","following_url":"https://api.github.com/users/jeyendranbalakrishnan/following{/other_user}","gists_url":"https://api.github.com/users/jeyendranbalakrishnan/gists{/gist_id}","starred_url":"https://api.github.com/users/jeyendranbalakrishnan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeyendranbalakrishnan/subscriptions","organizations_url":"https://api.github.com/users/jeyendranbalakrishnan/orgs","repos_url":"https://api.github.com/users/jeyendranbalakrishnan/repos","events_url":"https://api.github.com/users/jeyendranbalakrishnan/events{/privacy}","received_events_url":"https://api.github.com/users/jeyendranbalakrishnan/received_events","type":"User","site_admin":false},"created_at":"2018-11-17T07:44:53Z","updated_at":"2018-11-17T07:44:53Z","author_association":"NONE","body":"Your comments are very helpful, I'm understanding all this json-ld stuff better now :-)\r\nFor my application, the use-case is to parse, process and discard Web pages as they are fetched, so I think it would still be better to work directly with the Map<String, Object> returned by the compact() method., instead of writing the parsed object to an RDF4J store and then running SPARQL queries. Mainly the need is to extract specific properties, if they exist, from this object.\r\nI also found that almost all web pages will use the schema.org context, because this is Google's standard for SEO. So it suffices for me to restrict to this schema. \r\nFor implementing the queries, the JsonPath API seems very appropriate. Thanks for the tip.\r\nI have one final question: To form the JsonPath queries that can be applied to the output of compact(), I have to use the fully qualified path components in the query, right? like \"$.http://www.schema.org/Person.http://www.schema.org/name\" etc., right?\r\n"}}
{"actor":{"display_login":"jeyendranbalakrishnan"}}