Overpass does not find all cinemas - Overpass API documentation - r

In the openstreetmap overpass API-documentation there is the following example:
area[name="Bonn"];
node(area)[highway=bus_stop];
node(around:100)[amenity=cinema];
out;
Why does this query does not give the Kinopolis (in Bonn Bad Godesberg) as a result? See here: http://rpubs.com/hrbrmstr/overpass for the results from the API. The following two images illustrate that it really is <100m by foot.
Unfortunately i wasnt able to show it graphically on the openstreetmap... I dont know how to get the busstop as startingpoint of a route in the web interface...
Here is the Google-Maps version.

Since you've asked for cinema nodes only in your example query, the result will not include way 42473787. Here's how your query should look like to return ways with amenity=cinema instead:
area[name="Bonn"];
node(area)[highway=bus_stop];
way(around:100)[amenity=cinema];
(._;>;);
out meta;
To get both nodes and ways in one query, simply use a union:
area[name="Bonn"];
node(area)[highway=bus_stop]->.bus_stops;
(
way(around.bus_stops:100)[amenity=cinema];
node(around.bus_stops:100)[amenity=cinema];
);
(._;>;);
out meta;
Try it in overpass turbo!

Related

Trouble getting a SPARQL query using a URI

I'm having trouble acquiring instances from a subclass on Protege using SPARQL. The task is to create an ontology using information from a Website. To start this I have tried to get the contact information such as the Email addresses and Phone Numbers. I have provided screenshots of the Classes and Individual Tabs below:
Classes:
Individuals:
I want it to display a list of the two email addresses. I heard there was a way to get them using the URI.
How do I get the URI and how do I enter it after the rdf:type in the query's code?
As you can see in your screenshot, the URI of the 'Contact Email' class is http://www.semanticweb.org/cthom/ontologies/2021/untitled-ontology-34#Contact_Email. So, to get all instances of this class, you can use the following SPARQL query:
select ?contactEmail
where { ?contactEmail a <http://www.semanticweb.org/cthom/ontologies/2021/untitled-ontology-34#Contact_Email> }
Tip: try one of the online SPARQL tutorials to get a bit more familiar with the language.

Meteor: Single-Document Subscription

Whenever I encounter code snippets on the web, I see something like
Meteor.subscribe('posts', 'bob-smith');
The client can then display all posts of "bob-smith".
The subscription returns several documents.
What I need, in contrast, is a single-document subscription in order to show an article's body field. I would like to filter by (article) id:
Meteor.subscribe('articles', articleId);
But I got suspicious when I searched the web for similar examples: I cannot find even one single-document subscription example.
What is the reason for that? Why does nobody use single-document subscriptions?
Oh but people do!
This is not against any best practice that I know of.
For example, here is a code sample from the github repository of Telescope where you can see a publication for retrieving a single user based on his or her id.
Here is another one for retrieving a single post, and here is the subscription for it.
It is actually sane to subscribe only to the data that you need at a given moment in your app. If you are writing a single post page, you should make a single post publication/subscription for it, such as:
Meteor.publish('singleArticle', function (articleId) {
return Articles.find({_id: articleId});
});
// Then, from an iron-router route for example:
Meteor.subscribe('singleArticle', this.params.articleId);
A common pattern that uses a single document subscription is a parameterized route, ex: /posts/:_id - you'll see these in many iron:router answers here.

Using cfs:http-publish

I'm trying to use the cfs:http-publish package at https://github.com/CollectionFS/Meteor-http-publish. While I've got the GET - /api/list functionality working, I don't know how to obtain a single document:
(GET - /api/list/:id - find one published document).
Can someone provide a curl example of this, assuming a certain collection of objections.
eg: {a:3, b:2}, {a:4, b:3}, and requiring to obtain the object with {a:3}.
Thanks.
You need to put it in the query function.
HTTP.publish({collection: myList},function( ){
return myList.find(this.query);
});
this.query contains the data you sent with your request.
curl http://localhost:3000/api/myList?a=3
I don't know enough about mongo to know if this is a potential security risk, if anyone can comment on that please do.

Firebase REST API Query Parameters?

Is it possible to filter data returned by the Firebase REST API using query parameters? I don't see it mentioned one way or an other in the docs, but the client libraries support it, so I'm hoping it's possible. Thanks.
It might be a bit late to answer, but Firebase does allow querying data via REST.
You can use the orderby option together with limitToLast, startAt etc just like you would when using the SDK.
Checkout the Firebase guide for more details
I fought a little bit to have it working.
I actually needed 2 things:
combine limitToLast with orderBy as mentioned by idan
URL getUrl = new URL( url + "news.json?orderBy=\"timestamp\"&limitToLast=5" );
add a rule in the database to declare an index on this "column"
"news" : { ".indexOn": "timestamp" }
Firebase provides querying parameters. However, I don't think they are the querying parameters you are expecting them to be, which are ones that filter data. Firebase REST API provides querying options like auth, print, callback, format, and download. Check docs here
Without ordering by certain field, By combining params orderBy="$key" and limitToLast=5 you can get the last 5 of inserted data ordered by it's key
The documentation can be looked at here

Obtaining topic description in search api

I seem to be having problem pulling out the text content of the following query without making another call:
http://tinyurl.com/mgsewz2 via the mqlread api
{
"id": "/en/alcatraz_island",
"/common/topic/description": [{}],
"/common/topic/topic_equivalent_webpage": [],
"/common/topic/official_website": null
}
I can't retrieve the following
description
equivalent webpage (I'm looking for the en wiki page)
, but I can obtain the official_website url.
It looks like I can get it via the search api via output= but I can't walk through the entire set that I'm looking for without getting search request is too large error.
http://markmail.org/message/hd6pcveta7bhuz25#query:+page:1+mid:u7xegxlhtmhwiqbl+state:results
Thanks!
It you want to download large subsets of Freebase data, your best bet is to use the Freebase RDF Dumps. They contain all the properties that you listed above.

Resources