Language selection

Search

Sample Queries

The queries listed below are provided as examples to get you started using SPARQL. Find a query in the list and click Try the query to open it in the SPARQL endpoint. From there, you can modify it as needed and click Run to launch the query.


1 Concept hierarchy

1.1 Top concepts (Categories)

Find the top-level concepts (Categories) of Nomenclature. This query returns concepts that include property skos:topConceptOf and displays the ID and the preferred terms ( skos:prefLabel ).

				SELECT ?id ?prefLabel {
  ?id skos:topConceptOf nom: ;
     skos:prefLabel ?prefLabel
  FILTER(lang(?prefLabel)= "en")
}
ORDER BY ?prefLabel
			

1.2 Top 3 Levels

Hierarchy relations are expressed with skos:narrower (linking a concept to its child concepts) and with skos:broader (linking a concept to its single parent concept). This query returns the Nomenclature Categories (top-level concepts), their classes (second-level concepts), and their subclasses (third-level concepts), and displays the ID as well as the preferred term (skos:prefLabel).

				SELECT * {
  ?id skos:topConceptOf nom: ;
    skos:prefLabel ?prefLabel;
    skos:narrower ?idLv2.
  ?idLv2 skos:prefLabel ?prefLabelLv2;
    skos:narrower ?idLv3.
  ?idLv3 skos:prefLabel ?prefLabelLv3
  FILTER(lang(?prefLabel)= "en" && lang(?prefLabelLv2)= "en" && lang(?prefLabelLv3)= "en")
}
ORDER BY ?prefLabel
			

1.3 Direct children of a concept

This query returns the children (direct conenction only) for a single Nomenclature concept, e.g. nom:12838 (Category 08: Communication Objects). It returns the children URIs and their preferred terms in English and French (each concept is guaranteed to have exactly one English and one French preferred term).

				SELECT * {
  ?id skos:broader nom:12838; skos:prefLabel ?prefLabelEn, ?prefLabelFr.
  FILTER(lang(?prefLabelEn) = 'en')
  FILTER(lang(?prefLabelFr) = 'fr')
}				
			

1.4 All descendants of a concept

This query returns all descendants (direct and indirect children) of a single Nomenclature concept, e.g. nom:12838 (Category 08: Communication Objects). The property path uses inverse ( ^ ) and multiple occurrences ( + ) of skos:broader. It returns the descendant URIs and their preferred terms.

				SELECT * {
  nom:12838 (^skos:broader)+ ?descendant.
  ?descendant skos:prefLabel ?prefLabel.
  FILTER(lang(?prefLabel) = 'en')
}				
			

2 Concept creation and modification dates

Concept creation date is expressed with dct:created and concept modification date is expressed with dct:modified.

2.1 Last modified concept

This query returns the most recently modified concept. This can include new concepts as well as concepts that have had any significant (e.g. change to preferred terms) or insignificant change (e.g. typo fix in a definition). The query returns the concept ID, modification date, and preferred term.

				SELECT * {
  ?id a skos:Concept;
    dct:modified ?modifDate;
    skos:prefLabel ?prefLabel.
  FILTER(lang(?prefLabel) = "en")
}
ORDER BY DESC(?modifDate)
LIMIT 1			
			

2.2 Count modified concepts

This query counts concepts that were modified since their creation. This includes concepts that have had any significant (e.g. change to preferred terms) or insignificant change (e.g. typo fix in a definition).

				SELECT (COUNT(?modifDate) AS ?count) {
  [] a skos:Concept;
    dct:created ?creationDate;
    dct:modified ?modifDate
  FILTER(?modifDate > ?creationDate)
}				
			

2.3 Count created and modified concepts per year

This query counts the number of new concepts as well as modified concepts and groups them by year. This can include new concepts or concepts that have had any significant (e.g. change to preferred terms) or insignificant change (e.g. typo fix in a definition).

				SELECT ?year (COUNT(?modified) AS ?countModified) (COUNT(?created) AS ?countCreated) {
    {
        ?modified a skos:Concept;
             dct:modified ?modifDate
        BIND( year(?modifDate) AS ?year )
    }
    UNION
    {
        ?created a skos:Concept;
                 dct:created ?creationDate
        BIND( year(?creationDate) AS ?year )
    }
}
GROUP BY ?year
ORDER BY ?year
			

2.4 All changes within a date range

This query returns new concepts and existing concepts that have had any kind of modification This query returns new concepts and existing concepts that have had any significant (e.g. change to preferred terms) or insignificant change (e.g. typo fix in a definition) between e.g. January 1, 2018 and December 31, 2021. It returns the concept ID, preferred term, and latest modification date.

				SELECT * {
  ?id a skos:Concept;
     dct:modified ?modifDate;
     skos:prefLabel ?prefLabel.
  FILTER(lang(?prefLabel) = "en")
  FILTER(?modifDate >= "2018-01-01T00:00:00"^^xsd:dateTime && ?modifDate <= "2021-12-31T23:59:59"^^xsd:dateTime)
}
ORDER BY DESC(?modifDate)
				
			

2.5 Significant changes within a date range

This query returns new concepts, moved concepts, merged concepts, deprecated concepts, and concepts that have had changes to their preferred term in any language between two dates, e.g. July 26, 2018 and December 31, 2021. It returns the ID, preferred term, change type, change details, and modification date.

				SELECT ?id ?prefLabel ?revisionType ?desc ?modifDate {
    VALUES (?revisionType) {
        ("Addition - Concept"@en)
        ("Deletion - Concept"@en)
        ("Move"@en)
        ("Merge"@en)
        ("Addition - Preferred term"@en)
        ("Deletion - Preferred term"@en)
        ("Update - Preferred term"@en)
    }
  ?id a skos:Concept;
  rdfs:label ?prefLabel;
  skos:changeNote ?revision.
  ?revision rdfs:label ?revisionType;
  dc:description ?desc;
  cs:createdDate ?modifDate.
  FILTER(?modifDate >= "2018-07-26T00:00:00"^^xsd:dateTime && ?modifDate <= "2021-12-31T23:59:59"^^xsd:dateTime)
  FILTER(lang(?prefLabel)="en")
  FILTER(lang(?revisionType)="en")
  FILTER(lang(?desc)="en")
}
ORDER BY DESC(?modifDate)
				
			

3 Sources and contributors

3.1 Term sources

This query returns the term sources for all preferred terms in Nomenclature. Each term source is listed only once. It displays the Zotero link, full citation, count, and term source URI.

				SELECT (COUNT(*) AS ?count) ?termSource ?zotero ?biblio
{
    ?id skosxl:prefLabel/schema:citation ?termSource.
    ?termSource schema:url ?zotero;
                dct:bibliographicCitation ?biblio.
    FILTER(lang(?biblio) = "en")
}
GROUP BY ?termSource ?zotero ?biblio
			

3.2 Term contributors

This query returns the term contributors for all preferred terms in Nomenclature. Each term contributor is listed only once. It returns the number of contributors, their URI, names in English and French, and nicknames.

				SELECT (COUNT(*) AS ?count) ?contrib ?nameEn ?nameFr ?nickname
{
    ?id skosxl:prefLabel/dct:contributor ?contrib.
    ?contrib foaf:name ?nameEn,?nameFr;
             foaf:nick ?nickname.
    FILTER(lang(?nameEn) = "en")
    FILTER(lang(?nameFr) = "fr")
}
GROUP BY ?contrib ?nameEn ?nameFr ?nickname
				
			

3.3 Bibliographic citations

This query returns all bibliographic citations for all concepts. It returns the citation, concept ID, and bibliographic citation ID.

				SELECT * {
?id schema:citation ?citation
   OPTIONAL{?citation dct:bibliographicCitation ?biblio FILTER(lang(?biblio)="en")}
}				
			

3.4 Definition sources

This query returns the sources of a definition. It displays the Zotero link and full citation, as well as returns the count and definition source URI.

				SELECT (COUNT(*) AS ?count) ?defSource ?zotero ?biblio
{
    ?id skos:definition/schema:citation ?defSource.
    ?defSource schema:url ?zotero;
               dct:bibliographicCitation ?biblio.
    FILTER(lang(?biblio) = "en")
}
GROUP BY ?defSource ?zotero ?biblio
			

4 Image References

4.1 Count images

This query returns the number of images found in Nomenclature.

				SELECT (COUNT(*) AS ?images) {[] a skos:Concept; schema:image []}
			

4.2 Count concepts with images

This query returns the number of concepts in Nomenclature that include images.

				SELECT (COUNT(?id) AS ?concepts)
{
?id a skos:Concept;
   schema:image/schema:position 1.
}				
			

4.3 Images for a concept

This query returns all images associated with a concept, e.g. nom:11695 (blimp). It returns the preferred term, URL of the image, original URL of the image source, and credit line for the image.

				SELECT * {
    nom:11695 schema:image ?imageUri;
              skos:prefLabel ?prefLabel.
    ?imageUri a schema:ImageObject;
              schema:contentUrl ?image;
              schema:creditText ?imageSource;
              dct:source ?imageOriginal.
    FILTER(lang(?prefLabel) = "en")
}				
			

5 Labels

5.1 Concepts search by label

This query returns concepts whose preferred term contains a string, e.g. "wagon" (case insensitive). It displays the concept ID and label.

However, the REGEX() and CONTAINS() functions are inefficient. They should only be used for exploratory querying and especially not in the backend of a production system. In such cases, use full-text search (FTS) instead; see the section 07 below.

				SELECT ?id ?prefLabel
{
  ?id skos:prefLabel ?prefLabel .
  FILTER(REGEX(?prefLabel,"wagon","i"))
}				
			

5.2 Any term (and parent)

This query returns all concepts, in all languages, with preferred terms, alternative terms, and hidden terms (in any language) containing a string, e.g. "cabinet" (case insensitive). It displays the concept ID, preferred terms, alternative terms, hidden terms, and parents’ preferred terms in all languages.

				SELECT * {
    ?id skos:prefLabel|skos:altLabel|skos:hiddenLabel ?anyLabel;
       skos:prefLabel ?prefLabel;
       skos:broader/skos:prefLabel ?broaderLabel
    FILTER(REGEX(?anyLabel,"cabinet","i"))
    FILTER(lang(?prefLabel) = 'en' && lang(?broaderLabel) = 'en')
}				
			

5.3 Labels by language

This query returns what languages are used in structured labels (skosxl:Label) and their frequency.

				SELECT ?lang (COUNT(*) AS ?count) {
  [] a skosxl:Label;
     dct:language/skos:notation ?lang
} GROUP BY ?lang ORDER BY DESC(?count)
			

5.4 Inverted and natural form (using custom property)

This query returns the inverted and natural forms of Nomenclature terms containing a string, e.g. "struct" (case insensitive). This query uses the custom property nomo:invertedFormOf (as opposed to dct:type as in the query below). In order to provide a comprehensive list of search results, single-word terms are included even though these are not included in nomo:invertedFormOf. The inverted form can be found in both English and Canadian English. Inverted forms are available for the bottom three levels (primary, secondary, and tertiary terms), but are not included for the top three levels (categories, classes, and subclasses). The query displays the concept ID, natural order term, and inverted order term.

				SELECT ?id ?natural ?inverted {
   ?id skosxl:prefLabel ?prefLabel .
   ?prefLabel skosxl:literalForm ?natural .

   OPTIONAL{
    ?altLabel nomo:invertedFormOf ?prefLabel ;
              skosxl:literalForm ?inverted .
   }
   FILTER(CONTAINS(LCASE(?natural), "struct"))
   FILTER(langMatches(lang(?natural),'en'))
}				
			

5.5 Inverted and natural form (using dct:type)

This query returns the inverted and natural forms of Nomenclature terms containing a string, e.g. "struct" (case insensitive). An alternative term ( altLabel ) that has the type (dct:type) "inverted term" (aat:300404672) is the inverted form of the preferred term ( prefLabel ). In order to provide a comprehensive list of search results, single-word terms are included even though these are not tagged as "inverted terms". The inverted form can be found in both English and Canadian English. Inverted forms are available for the bottom three levels (primary, secondary, and tertiary terms), but are not included for the top three levels (categories, classes, and subclasses). Note that, compared to the previous solution, this query requires the users control for the language of the inverted terms. This query displays the concept ID, natural order term, and inverted order term.

				SELECT ?id ?natural ?inverted {
    ?id skosxl:prefLabel ?prefLabel .
    ?prefLabel skosxl:literalForm ?natural .
    OPTIONAL{
        ?id skosxl:altLabel ?altLabel .
        ?altLabel dct:type aat:300404672;
                  skosxl:literalForm ?inverted .
        FILTER(langMatches(lang(?inverted),'en'))
    }
    FILTER(CONTAINS(LCASE(?natural), "struct"))
    FILTER(langMatches(lang(?natural),'en'))
}				
			

5.6 Inverted form, Canadian variant

This query returns Nomenclature terms containing a string, e.g. "armo" (case insensitive). An alternative term (altLabel) that has the type (dct:type) "inverted term" (aat:300404672) is the inverted form of the preferred term (prefLabel). In order to provide a comprehensive list of search results, the English term is included when there is no Canadian English term, and single-word terms are included even though these are not tagged "inverted term". Inverted forms are available for the bottom three levels (primary, secondary, and tertiary terms), but are not included for the top three levels (categories, classes, and subclasses). The query displays concept ID, term, level, and level name.

				SELECT distinct ?id ?display ?levelNum ?levelName
{
  ?id skos:inScheme nom:;
    skos:prefLabel|skos:altLabel|skos:hiddenLabel ?anyLabel;
    skos:prefLabel ?prefEn;
    schema:isPartOf ?level.
  FILTER(REGEX(?anyLabel,"armo","i"))
  ?level schema:position ?levelNum;
    skos:prefLabel ?levelName.
  FILTER(lang(?levelName) = "en")
  FILTER(lang(?prefEn) = "en")
  OPTIONAL{
    ?id skos:prefLabel ?prefEnCa
    FILTER(lang(?prefEnCa) = "en-ca")
  }
  OPTIONAL{
    ?id skosxl:altLabel ?alt.
    ?alt dct:type aat:300404672;
      skosxl:literalForm ?invEnCa .
    FILTER(lang(?invEnCa) = "en-ca")
  }
  OPTIONAL{
    ?id skosxl:altLabel ?alt.
    ?alt dct:type aat:300404672;
      skosxl:literalForm ?invEn .
    FILTER(lang(?invEn) = "en")
  }
  BIND(COALESCE(?invEnCa,?prefEnCa,?invEn,?prefEn) AS ?display)
  BIND(str(?display) AS ?literal)
} ORDER BY ?literal
			

5.7 Labels by language

This query returns all preferred terms in Canadian English (en-CA). It returns the ID and preferred term.

				SELECT * {
    ?id skos:prefLabel ?prefLabel.
    FILTER(langMatches(lang(?prefLabel), "en-CA"))
}				
			

This query can be modified to search for preferred terms in any language:

6 Notes and definitions

6.1 Scope notes

This query searches for scope notes that contain a string, e.g. "dress", and returns the ID, preferred term, parent, and note.

				SELECT * {
    ?id skos:scopeNote ?scopeNote;
       skos:prefLabel ?prefLabel;
       skos:broader ?parent.
       FILTER(lang(?scopeNote) = 'en' && CONTAINS(LCASE(?scopeNote), "dress"))
    FILTER(lang(?prefLabel) = 'en')
}				
			

6.2 Definitions

This query searches for definitions that contain a string, e.g. "dress", and returns the ID, preferred term, parent, and definition.

				SELECT * {
    ?id skos:prefLabel ?prefLabel;
       skos:broader ?parent;
       skos:definition ?def.
    ?def dct:language nomLang:en;
         rdf:value ?value.
      FILTER(CONTAINS(LCASE(?value), "dress"))
    FILTER(lang(?prefLabel) = 'en')
}				
			

6.3 Scope notes and definitions

This query searches for scope notes or definitions that contain a string, e.g. "dress", and returns the ID, preferred term, parent, note, definition, and URIs.

				SELECT * {
    {
        ?id skos:scopeNote ?scopeNote;
           skos:prefLabel ?prefLabel;
           skos:broader ?parent.
        FILTER(lang(?scopeNote) = "en" && CONTAINS(LCASE(?scopeNote), "dress"))
    } UNION {
        ?id skos:definition ?def;
            skos:prefLabel ?prefLabel;
            skos:broader ?parent .
        ?def rdf:value ?defText .
        FILTER(lang(?defText) = "en" && CONTAINS(LCASE(?defText), "dress"))
    }
    FILTER(lang(?prefLabel)="en")
}				
			

6.4 skos:notation

This query searches for the skos:notation (Parks Canada Descriptive and Visual Dictionary code) e.g. "02-00147", and returns the ID, preferred term, and parent.

				SELECT * {
    ?id skos:notation "02-00147".
    ?id dc:identifier ?conceptId;
              skos:prefLabel ?prefLabel;
              skos:broader ?parent.
    FILTER(lang(?prefLabel) = "en")
}				
			

6.5 All data about a concept

This complex query returns all data about a concept, e.g. nom:1090 (chair). It returns sub-objects representing structured labels, structured definitions, structured position (the number determining the position of the concept within the hierarchy), images, etc. It also includes concept revisions (skos:changeNote) but not the detailed data about these revisions.

				describe ?id ?relatedId {
  BIND(nom:1090 AS ?id)
  ?id schema:position|skosxl:prefLabel|skosxl:altLabel|skos:definition|schema:image ?relatedId
}				
			

7 Full-Text Search (FTS)

While searching for strings in a text is possible using pure SPARQL functions such as CONTAINS() and REGEX() , it is not recommended to do this in a production system because this operation is extremely ineffective. First, it would need to retrieve from the database all the text fields, and then, against each of which, it would apply the search criterion.

Instead, the use of the Lucene full text search (FTS) engine is recommended. The Lucene GraphDB connector (available only in English) synchronizes and indexes the required textual fields, as well as quickly and efficiently matches them against a user query.

The Lucene query is expressed in the Lucene Query syntax (available only in English), nested in a SPARQL query.

Query search words are case insensitive (e.g. "Chair" matches "chair" and vice versa). UPPERCASE is reserved for boolean operators such as AND and OR . The default behaviour for multi-term queries is to search for any of the search terms. For example, the search query medical chair will find all concepts containing either the term "medical" or "chair"; however, concepts that include both terms will be ranked higher.

Using the operator AND (e.g. medical AND chair ) will search for both terms.

Phrase search is performed using quotes around the desired sequence. For example, the search query "medical chair" will search for exactly these two terms in this order. Don't forget that the search query is embedded in SPARQL, so you can use triple quotes or triple apostrophes to avoid the need to escape the quotes (e.g. ''' "medical chair" ''' ).

Wildcard queries search for parts of terms (e.g. *brace* , will match "orthopedic brace", "vambrace", and "bracelet").

Many more advanced queries are possible. Refer to the section on query syntax in the Lucene documentation.

7.1 FTS indexes

Three Lucene indexes have been created. Each is an extension of the previous one.

If you look carefully in fts-indexes.ru these connectors only have one field text . Multiple property chains per field have been used to merge the multiple labels into one.

7.2 FTS by preferred term

This FTS query searches for a string in luc-index:prefLabel index, e.g. "chair". It returns concept ID and preferred term

				SELECT ?id ?prefLabel
{
  ?search a luc-index:prefLabel ;
      luc:query "chair" ;
      luc:entities ?id .
  ?id skos:prefLabel ?prefLabel.
  FILTER(lang(?prefLabel)="en")
}				
			

7.3 FTS for all labels

This FTS query searches not in luc-index:allLabels index (preferred, alternative, and hidden terms), for a string, e.g. "chair". It returns the concept ID, preferred terms, snippet text, and total hits.

				SELECT ?id ?prefLabel ?snippetText ?totalHits
{
  ?search a luc-index:allLabels ;
      luc:query "chair" ;
      luc:entities ?id;
      luc:totalHits ?totalHits .
  ?id luc:snippets/luc:snippetText ?snippetText ;
       skos:prefLabel ?prefLabel .
  FILTER(lang(?prefLabel)="en")
}				
			

Note that this query returns more results than the previous one because it searches in more fields.

7.4 FTS for all text

This FTS query searches in allText index for a string, e.g. "chair". It returns the concept ID, preferred terms, definition, note, snippet text, and total hits.

				SELECT ?id ?prefLabel ?definition ?scopeNote ?snippetText ?totalHits
{
    ?search a luc-index:allText ;
            luc:query "chair" ;
            luc:entities ?id;
            luc:totalHits ?totalHits .
    ?id luc:snippets/luc:snippetText ?snippetText ;
            skos:prefLabel ?prefLabel  .
    OPTIONAL{?id skos:definition/rdf:value ?definition. FILTER(lang(?definition)="en")}
    OPTIONAL{?id skos:scopeNote ?scopeNote. FILTER(lang(?scopeNote)="en")}
    FILTER(lang(?prefLabel)="en")
}				
			

This query returns even more results than the two previous queries, as it searches most text fields: altLabel , hiddenLabel , and definition .

7.5 More complex FTS query

This FTS query searches in allText index for a string, e.g. "chair" and returns the snippet text and match score.

				SELECT ?id ?prefLabel ?definition ?scopeNote ?snippetText ?score
{
    ?search a luc-index:allText ;
            luc:query "chair" ;
            luc:entities ?id.
    ?id luc:snippets/luc:snippetText ?snippetText;
            luc:score ?score;
            skos:prefLabel ?prefLabel  .
    OPTIONAL{?id skos:definition/rdf:value ?definition. FILTER(lang(?definition)="en")}
    OPTIONAL{?id skos:scopeNote ?scopeNote. FILTER(lang(?scopeNote)="en")}
    FILTER(lang(?prefLabel)="en")
}				
			

7.6 phrase query

This phrase query searches for a particular sequence of terms in the text, e.g. “child’s chair”. The query string should be quoted in single quotes. Note how triple quoting in SPARQL is used in order to avoid having to escape the single quotes.

				SELECT ?id ?snippetText ?totalHits
{
  ?search a luc-index:prefLabel ;
      luc:query """ "child's chair" """;
      luc:entities ?id;
      luc:totalHits ?totalHits .
  ?id luc:snippets/luc:snippetText ?snippetText .
}				
			

Please note that Nomenclature also includes inverted terms as altLabel , e.g. "chair, child's", so that phrase search can be done in luc-index:allLabels without worrying whether the user searches with a normal or inverted form.

This query combines the graph structure and the FTS index. It is very useful as it allows to combine the speed and efficiency of the FTS with all the information in the structure of the Knowledge Graph.

For example, assuming that most chairs are in "Category 02: Furnishings" ( nom:967 ), it might be interesting to search for chairs outside of that category.

				SELECT ?id ?prefLabel ?categoryLabel
{
    ?search a luc-index:allText ;
            luc:query "chair" ;
            luc:entities ?id.
    ?id luc:snippets/luc:snippetText ?snippetText;
            skos:prefLabel ?prefLabel;
            skos:broader+ ?category.
    nomLevel:1 skos:member ?category.
    ?category  skos:prefLabel ?categoryLabel .

    FILTER(?category != nom:967) # Category 02: Furnishings
    FILTER(lang(?prefLabel)="en")
    FILTER(lang(?categoryLabel)="en")
}				
			

The query allows us to find concepts such as "altar chair" (nom:13109) and "electric chair" (nom:10051).

See Combining Lucene Results with GraphDB Data (available only in English) in the GraphDB documentation.

7.8 FTS by preferred term, sorted case insensitively

In auto-complete applications, user input is often treated in a case-insensitive way. The FTS index includes all terms lower-cased and stemmed, so it already takes care of case-insensitive processing in FILTERing. The results should also be sorted in a case-insensitively way. Here is an example query:

				SELECT ?id ?prefLabel
{
    ?search a luc-index:prefLabel ;
            luc:query "chair" ;
            luc:entities ?id.
    ?id skos:prefLabel ?prefLabel .
} ORDER BY ASC(LCASE(?prefLabel))
			

8 Counting

Counting resources of a particular type in the graph is traditionally done using the COUNT() SPARQL aggregation function (see the next query). However, this is inefficient and should never be used in a production system with a high load.

For this reason, the important counts have been pre-computed and stored in the semantic dataset description (the VOID graph). This graph is available at https://nomenclature.info/.well-known/voidand is loaded in the repository for online querying. Further queries will display pre-computed counts by using so-called "partitions" (subsets of triples of the dataset).

8.1 Count entities per type

This query counts the number of entities per rdf:type. It returns all the types present in the repository.

				SELECT (COUNT(*) AS ?count) ?type {
  ?e rdf:type ?type .
}
GROUP BY ?type
ORDER BY DESC(?count)
			

8.2 Count concepts

This query displays the number of concepts (from VOID).

				SELECT * {
    <https://nomenclature.info/dataset> void:classPartition [ void:class skos:Concept;
                                      void:entities ?conceptsCount ]
}				
			

8.3 Count images

This query displays the number of images (from VOID).

				SELECT * {
    <https://nomenclature.info/dataset> void:classPartition [ void:class schema:ImageObject;
                                      void:entities ?imagesCount ]
}				
			

8.4 Count terms

This query displays the number of terms (labels) (from VOID).

				SELECT * {
    <https://nomenclature.info/dataset> void:classPartition [ void:class skosxl:Label;
                                      void:entities ?termsCount ]
}				
			

8.5 Count terms by language

This query displays how many terms there are for each language (from VOID). It uses the VOID Extensions ontology ( vext: ).

				SELECT * {
    <https://nomenclature.info/dataset> vext:languagePartition [ vext:language ?lang;
                                         void:triples ?termsCount ]
}				
			

8.6 Count co-references per domain

This query displays how many co-references are present (from VOID). It uses class void:Linkset. The count is broken down by target dataset and void:linkPredicate (exactMatch or closeMatch). void:target lists both datasets that are linked (<https://nomenclature.info/dataset> and the external dataset), but only the external one is returned to avoid clutter.

				SELECT * {
  ?linkset a void:Linkset;
    rdfs:label         ?linksetLabel;
    void:linkPredicate ?linkPredicate;
    void:triples       ?triplesCount;
    void:target        ?dataset
  FILTER(?dataset != <https://nomenclature.info/dataset>)
  # ?dataset rdfs:label ?datasetLabel  FILTER(lang(?datasetLabel)="en")
} ORDER BY DESC(?triplesCount)
			

8.7 Count deprecated concepts

This query returns the number of deprecated concepts (from VOID).

				SELECT * {
  <https://nomenclature.info/dataset> void:propertyPartition
    [void:property owl:deprecated; void:triples ?deprecatedCount]
}				
			

Date modified: