ndarville / danish-polls

A collection of Danish opinion polls
https://hafniatimes.com/articles/2014/09/14/danish-polls
MIT License
4 stars 2 forks source link

Testing #1

Closed ndarville closed 10 years ago

ndarville commented 10 years ago
ndarville commented 10 years ago

Schema

schema.json:

{
    "fields": [
        {
            "name": "PollingFirms",
            "title": "Polling Firms",
            "constraints": {
                "required": true,
                "type": "http://www.w3.org/2001/XMLSchema#string"
            }
        },
        {
            "name": "Date",
            "title": "Date",
            "constraints": {
                "required": true,
                "type": "http://www.w3.org/2001/XMLSchema#date",
                "datePattern": "%-m/%-d/%Y"
            }
        },
        {
            "name": "V",
            "title": "Venstre",
            "constraints": {
                "required": true,
                "type": "http://www.w3.org/2001/XMLSchema#float"
            }
        },
        {
            "name": "A",
            "title": "Socialdemokraterne",
            "constraints": {
                "required": true,
                "type": "http://www.w3.org/2001/XMLSchema#float",
                "pattern": "([0-9]|[0-9][0-9])\.[0-9]"
            }
        },
        {
            "name": "O",
            "title": "Dansk Folkeparti",
            "constraints": {
                "required": true,
                "type": "http://www.w3.org/2001/XMLSchema#float",
                "pattern": "([0-9]|[0-9][0-9])\.[0-9]"
            }
        },
        {
            "name": "B",
            "title": "Radikale Venstre",
            "constraints": {
                "required": true,
                "type": "http://www.w3.org/2001/XMLSchema#float",
                "pattern": "([0-9]|[0-9][0-9])\.[0-9]"
            }
        },
        {
            "name": "F",
            "title": "Socialistisk Folkeparti",
            "constraints": {
                "required": true,
                "type": "http://www.w3.org/2001/XMLSchema#float",
                "pattern": "([0-9]|[0-9][0-9])\.[0-9]"
            }
        },
        {
            "name": "I",
            "title": "Liberal Alliance",
            "constraints": {
                "required": true,
                "type": "http://www.w3.org/2001/XMLSchema#float",
                "pattern": "([0-9]|[0-9][0-9])\.[0-9]"
            }
        },
        {
            "name": "C",
            "title": "Det Konservative Folkeparti",
            "constraints": {
                "required": true,
                "type": "http://www.w3.org/2001/XMLSchema#float",
                "pattern": "([0-9]|[0-9][0-9])\.[0-9]"
            }
        },
        {
            "name": "K",
            "title": "Kristendemokraterne",
            "constraints": {
                "required": true,
                "type": "http://www.w3.org/2001/XMLSchema#float",
                "pattern": "([0-9]|[0-9][0-9])\.[0-9]"
            }
        },
        {
            "name": "Reds",
            "title": "Rød Blok (A+B+F+Ø)",
            "constraints": {
                "required": true,
                "type": "http://www.w3.org/2001/XMLSchema#float",
                "pattern": "([0-9]|[0-9][0-9])\.[0-9]"
            }
        },
        {
            "name": "Blues",
            "title": "Blå Blok (V+O+I+C+K)",
            "constraints": {
                "required": true,
                "type": "http://www.w3.org/2001/XMLSchema#float",
                "pattern": "([0-9]|[0-9][0-9])\.[0-9]"
            }
        }
    ]
}
ndarville commented 10 years ago

Just need to present it as an HTML table now.

Also considering an option that hides inconsistencies < x.

ndarville commented 10 years ago

Example output:

"Coalition inconsistencies"
"[
  "R: 7/30/2014, Greens, 54.8 vs. 53.9",
  "L: 6/2/2014, Megafon, 50.8 vs. 51.5",
  "R: 6/2/2014, Megafon, 48.6 vs. 48.5",
  "L: 5/28/2014, Megafon, 47.9 vs. 48.1",
  "R: 5/28/2014, Megafon, 51.7 vs. 51.9",
  "R: 12/2/2013, Voxmeter, 52.2 vs. 52.1",
  "R: 11/4/2013, Voxmeter, 52.4 vs. 52.6",
  "R: 11/4/2013, Greens, 55.8 vs. 56.4",
  "R: 10/24/2013, Epinion, 55.5 vs. 55.7",
  "R: 10/20/2013, Voxmeter, 52.2 vs. 52.3",
  "R: 8/29/2012, Megafon, 56.3 vs. 55.3",
  "R: 9/15/2011, Election Results, 49.7 vs. 49.8"
]"

"Lead inconsistencies"
"[
  "5/2/2014, Greens, 3.7 vs. 5.7",
  "4/24/2014, Megafon, 4.4 vs. 4",
  "2/16/2014, Rambøll, 6 vs. 7.2",
  "7/30/2013, Epinion, 9.3 vs. 11.7",
  "7/1/2013, Voxmeter, 7.7 vs. 9.7",
  "4/22/2013, Voxmeter, 14.3 vs. 13.3",
  "2/28/2013, Megafon, 11.7 vs. 11.2",
  "10/22/2012, Epinion, 11.7 vs. 12.7",
  "9/7/2012, Greens, 14.6 vs. 13.6",
  "7/10/2012, Gallup, 13.5 vs. 14.5",
  "4/11/2012, Gallup, 9.3 vs. 9.7"
]"

The current text reads:

Open your browser’s console log to see the results.

NB: Any (minor) inconsistencies may be the result of relying on single-decimal values. This is why even the election result returns an error.

To view the test results, right-click anywhere on this page and choose “Inspect Element”.