Can this query be modified to only return results with a non-trivial "geo" value?
http://search.twitter.com/search.json?geocode=38.947,-77.090,39km&result_type=recent&page=1
Related
I am new to GraphQL and trying to understand how to only return a subsection of the resulting query. For example, here is my cypher query in Neo4j:
MATCH (u:User)-[HAS_FRIEND]-(f:User)
WHERE u.name = "Joe"
RETURN f.name
Notice how the above query only returns the friend names.
GraphQL
Here's a sample of GraphQL version of the above cypher query.
Input
{
"where": {
"name": "Joe"
}
}
Query
query Query($where: NameWhere) {
names(where: $where) {
name
friends {
name
}
}
}
Expected Output
Obviously, I expect output to include friends name array and the name of the user having the friend. But, what if I only want the friends array like the cypher query gives me?
While this is a simple example, I am using a graph database that has a series of connections and my nesting is looking pretty deep, but I only really need a subquery from the result. A great example is with localization - I don't need the country and language (locale), etc. in every query; I only want the subquery result (e.g. the spelling in UK/ENG is colour and in US/ENG is color).
Neo4j offers a Javascript GraphQL library that is able to handle your use case (and many more)!
Please have a look at the documentation for information on how to get started. See even the example queries, where this one is fairly close to what you are looking for.
Anyhow, the GraphQL query provided above, using the #neo4j/graphql library, could look like so:
query Query {
users (where: { name: "Joe" }) {
friends {
name
}
}
}
(Note that the where parameter ("Joe") is provided in-line in this case)
I need to filter calendar views on their case insensitive subject as returned by Microsoft Graph API.
What I have tried so far:
I have confirmed that a case sensitive filter functions: filter=startswith(subject,'mystring')
I get an error when I add tolower to my query string: filter=startswith(tolower(subject),'mystring')
I even get an error by just using teh tolower function in the filter: filter=tolower(subject) eq 'mywholestring' which I think might indicate that tolower is not suported.
Yet I found broad use of tolower in the OneNote documentation: https://learn.microsoft.com/en-us/graph/onenote-get-content
This is the OData reference: https://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752358
I also have hard times with MS Graph case sensitivity, but here is a temporary workaround that I'm using:
https://my.site.name/_api/web/siteusers?$filter=substringof('Adam', Title) or substringof('adam', Title)
Maybe that will give you some ideas.
Foursquare Api with Query
As per above link , i am using foursquare and passing categories in query as Strip Club,Adult Boutique, Erotic Museum .. and in response i m getting some irrelevant results like for Bushey Country Club which is under Golf Courses category , i can't figure out why foursquare returning result outside passed categories as query , any1 can help ?
Explore API can't be a good choice for filter venues category.you can use Search API with category id filter. for example, this API return nightlife category venue at Vilnius to you http://api.foursquare.com/v2/venues/search?ll=54.6872,25.2797&categoryId=4d4b7105d754a06376d81259
I am receiving 403 error from search api when using this query:
"सार्वजनिक स्वास्थ्य जॉन्स हॉपकिन्स विश्वविद्यालय" OR "एमए एन ए
पौष्टिक सहायता उत्पाद निगम" OR "मेडिसिन्स सैंस फ्रंटियर्स"
Error I have got from Twitter's api is:
{exceptionCode=[8e13056f-6071abbc], statusCode=403, message=Missing or
invalid url parameter., code=195, retryAfter=-1,
rateLimitStatus=RateLimitStatusJSONImpl{remaining=447, limit=450,
resetTimeInSeconds=1464249586, secondsUntilReset=695}, version=4.0.1}
It is strange because if I cut any element from original query it works.
The request I send is:
https://api.twitter.com/1.1/search/tweets.json?q=%22%E0%A4%B8%E0%A4%BE%E0%A4%B0%E0%A5%8D%E0%A4%B5%E0%A4%9C%E0%A4%A8%E0%A4%BF%E0%A4%95%20%E0%A4%B8%E0%A5%8D%E0%A4%B5%E0%A4%BE%E0%A4%B8%E0%A5%8D%E0%A4%A5%E0%A5%8D%E0%A4%AF%20%E0%A4%9C%E0%A5%89%E0%A4%A8%E0%A5%8D%E0%A4%B8%20%E0%A4%B9%E0%A5%89%E0%A4%AA%E0%A4%95%E0%A4%BF%E0%A4%A8%E0%A5%8D%E0%A4%B8%20%E0%A4%B5%E0%A4%BF%E0%A4%B6%E0%A5%8D%E0%A4%B5%E0%A4%B5%E0%A4%BF%E0%A4%A6%E0%A5%8D%E0%A4%AF%E0%A4%BE%E0%A4%B2%E0%A4%AF%22%20OR%20%22%E0%A4%8F%E0%A4%AE%E0%A4%8F%20%E0%A4%8F%E0%A4%A8%20%E0%A4%8F%20%E0%A4%AA%E0%A5%8C%E0%A4%B7%E0%A5%8D%E0%A4%9F%E0%A4%BF%E0%A4%95%20%E0%A4%B8%E0%A4%B9%E0%A4%BE%E0%A4%AF%E0%A4%A4%E0%A4%BE%20%E0%A4%89%E0%A4%A4%E0%A5%8D%E0%A4%AA%E0%A4%BE%E0%A4%A6%20%E0%A4%A8%E0%A4%BF%E0%A4%97%E0%A4%AE%22%20OR%20%22%E0%A4%AE%E0%A5%87%E0%A4%A1%E0%A4%BF%E0%A4%B8%E0%A4%BF%E0%A4%A8%E0%A5%8D%E0%A4%B8%20%E0%A4%B8%E0%A5%88%E0%A4%82%E0%A4%B8%20%E0%A4%AB%E0%A5%8D%E0%A4%B0%E0%A4%82%E0%A4%9F%E0%A4%BF%E0%A4%AF%E0%A4%B0%E0%A5%8D%E0%A4%B8%22&count=100&since=2016-05-23&with_twitter_user_id=true&include_entities=true
Do you have any idea what is wrong?
You just hit a query limit, you can get similar failures with even a simple repeated A OR B query once it gets over the max length.
https://dev.twitter.com/rest/reference/get/search/tweets
q: A UTF-8, URL-encoded search query of 500 characters maximum,
including operators. Queries may additionally be limited by
complexity.
Since you want an OR, you should probably query 3 times and union the results in your code.
The annotation #Query in package org.springframework.data.neo4j.annotation provides certain count attributes like countQuery, countQueryName.
/**
* #return simpler count-query to be executed for #{see Pageable}-support {self} will be provided by the node-id of the current entity other parameters (e.g. {name}) by the given named params
*/
String countQuery() default "";
/**
* #return name of the named count query to be used for this annotated method, instead of Class.method.count
*/
String countQueryName() default "";
Can somebody please explain the usage of these? To be more specific I've written a query to fetch the posts on a topic. The query results will be paginated. The query below works fine and gives me the result.
#Query("start post=node:__types__(className='com.xxx.entity.Post'), topic=node({0}) match post-[:TOPIC_POST]-topic return post")
Page<Post> getPostsByTopic(Topic topic, Pageable page);
Now I also want the total number of results as well, do I have to write another query for this or is there a way to accommodate count query in this?
I think countQuery should work for you, but you still need to write the count query
If it is required that paged results return the correct total count,
the #Query annotation can be supplied with a count query in the
countQuery attribute. This query is executed separately after the
result query and its result is used to populate the totalCount
property of the returned Page.
http://docs.spring.io/spring-data/neo4j/docs/current/reference/htmlsingle/#d0e2712