Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
titleOutdated

This material pertains to outdated versions of VIVO. Rather than archiving the material, it should be updated to reflect current versions of VIVO.

These examples show how to count the entities in your VIVO that do not have labels.  In each query, the entities of interest are selected using type, then OPTIONAL is used to include entities with and without labels, FILTER is used to select only those results for which there is no label value, that is, ?label is not bound.

The resulting collection of entities is counted using COUNT(DISTINCT ?s)) in the SELECT statement.

Code Block
titleCount agents without labels
SELECT countCOUNT(DISTINCT ?s)
WHERE {
    ?s rdf:type foaf:Agent .
    OPTIONAL {?s rdfs:label ?label .}
    FILTER(!bound(?label))
}

...

Code Block
titleCount positions without labels
SELECT countCOUNT(DISTINCT ?s)
WHERE {
    ?s rdf:type vivo:Position .
    OPTIONAL {?s rdfs:label ?label .}
	FILTER(!bound(?label))
}

...

Code Block
titleCount positions without labels
SELECT countCOUNT(DISTINCT ?s)
WHERE {
    ?s rdf:type vivo:Position .
    OPTIONAL {?s rdfs:label ?label .}
	FILTER(!bound(?label))
}

...

Code Block
titleCount publications without labels
SELECT countCOUNT(DISTINCT ?s)
WHERE {
    ?s rdf:type vivo:InformationResource .
    OPTIONAL {?s rdfs:label ?label .}
    FILTER(!bound(?label))
}

...