12

I am attempting some data mining via data.stackexchange but failing in my current task, as I cannot find the "off topic reason" for closed "off-topic" questions.

Given a closed 'off topic' question such as my randomly chosen victim question, 17335689:

question 17335689

We can see from visiting the question that its "Off-Topic Reason" is:

questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic

...but how can we craft a query in Data.Stackexchange that unearths this fact? (i.e. that returns the CloseAsOffTopicReasonType for a closed question)

I've tried by writing a series of queries here:

https://data.stackexchange.com/stackoverflow/query/309888/looking-for-off-topic-close-reason-details

None of the many queries contained at that link unearthed the "Off topic reason" for that question.

There is a "pending flags" table that points back to Posts. But there are no pending flags for this closed question.

(I am now certain that PendingFlags only exist when a question is not yet closed.)

I've included step by step breakdown of what I've tried so far in the comments of the query

I looked in the following tables:

  • Posts
  • PostHistory
  • PendingFlags
  • Comments
  • Votes
  • ReviewTasks
  • ReviewTaskResults

None of them contained the data that clearly does exist.

4
+50

You can't write such a query at the moment because that data is not in any tables of the current schema in SEDE. The same conclusion was reached by Yes in an answer on How to determine why a question was closed from the data dump/data explorer

The other option might be the Stack Exchange API. The endpoint for a specific question doesn't output the off-topic sub close reason in a field, but ....

{
    "items": [
        {
            "closed_details": {
                "description": "This question appears to be off-topic. The users who voted to close gave this specific reason: <ul class=\"close-as-off-topic-status-list\">\r\n        <li>&quot;Questions asking us to <b>recommend or find a tool, library or favorite off-site resource</b> are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, <a href=\"http://meta.stackoverflow.com/q/254394/\">describe the problem</a> and what has been done so far to solve it.&quot; &ndash; Juhana, Toto, ThiefMaster</li>\r\n    </ul>",
                "reason": "off-topic"
            },
            "link": "http://stackoverflow.com/questions/17335689/good-jquery-plugin-for-image-zoom-in-an-absolute-position-div-to-the-side-like",
            "title": "Good jQuery plugin for image zoom in an absolute position div to the side? (like ecommerce sites)"
        }
    ]
}

...as you can see the exact reason is in the description of the closed_details type. You can parse that to get the sub-close reason. The downside though of the API is that only 10000 calls per day are allowed and requests are throttled per IP-address so you won't be able to analyze/parse large sets.

  • That's perfect. Parsing the closed_details is not only suitable, but exactly the sort of thing I enjoy. The 10,000 calls per day limit will not be a problem. Excellent. – Leon Bambrick May 8 '15 at 23:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .