Is the total number of triples in a graph dataset even?

@Pouya

You can run the query below to get the answer you’re looking for.

Click to see it live on DBpedia (query form, live results), and on DBpedia-Live (query form, live results).

As of this writing, DBpedia is ODD, and DBpedia-Live is EVEN.

SELECT ?TotalTriples
       ?modulo
       ?OddOrEven
  WHERE
    {
      BIND ( IF ( ?modulo = 0 , "EVEN" , "ODD" ) AS ?OddOrEven )
        { 
          SELECT ( ( COUNT ( * ) ) AS ?TotalTriples ) 
                 ( bif:MOD ( COUNT ( * ) , 2 ) AS ?modulo )
          WHERE
            {
              ?s ?p ?o .
            }
          LIMIT 1
        }
    }
1 Like