<commit_before>{{!
@param Array<URI> classes
@param int        limit
@param int        offset
}}

PREFIX csdb:    <http://cs.dbpedia.org/property/>
PREFIX dbo:     <http://dbpedia.org/ontology/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?subject
      (STR(SAMPLE(?_label)) AS ?label)
      (STR(SAMPLE(?_description)) AS ?description) 
      (GROUP_CONCAT(DISTINCT ?surfaceForm ; separator = "|") AS ?surfaceForms)
WHERE {
  {
    SELECT ?subject
    WHERE {
      {
        SELECT ?subject (COUNT(?link) AS ?inDegree)
        WHERE {
          GRAPH <http://cs.dbpedia.org> {
            VALUES ?class {
              {{#classes}}
              <{{{.}}}>
              {{/classes}}
            }
            ?subject a ?class .
            ?link dbo:wikiPageWikiLink ?subject .
          }
        }
        GROUP BY ?subject
        ORDER BY DESC(?inDegree)
      }
    }
    OFFSET {{offset}}
    LIMIT 1000
  }
  GRAPH <http://cs.dbpedia.org> {
    ?subject rdfs:label ?_label ;
      dbo:abstract ?_description .
    FILTER (!REGEX(?_label, "^(\\p{Lu}\\.?)+$") {{! Filter out abbreviations, such as "R.E.M.". }}
            &&
            !REGEX(?_label, "^.*\\d+.*$") {{! Eliminate digits }}
            &&
            (STRLEN(?_description) > 140) {{! Get only resources with longer descriptions. }} 
            &&
            langMatches(lang(?_label), "cs")
            &&
            langMatches(lang(?_description), "cs"))
    VALUES ?surfaceFormProperty {
      csdb:name
      csdb:název
      csdb:příjmení
      dbo:birthName
      dbo:wikiPageWikiLinkText
      dcterms:title
    }
    OPTIONAL {
      ?subject ?surfaceFormProperty ?surfaceForm .
      {{! Prevent empty surface forms }}
      FILTER (isLiteral(?surfaceForm)
              &&
              STRLEN(STR(?surfaceForm)) > 2
              &&
              !regex(STR(?surfaceForm), "^\\s+$"))<commit_msg>Maximum length of guessed label set to 40<commit_after>{{!
@param Array<URI> classes
@param int        limit
@param int        offset
}}

PREFIX csdb:    <http://cs.dbpedia.org/property/>
PREFIX dbo:     <http://dbpedia.org/ontology/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?subject
      (STR(SAMPLE(?_label)) AS ?label)
      (STR(SAMPLE(?_description)) AS ?description) 
      (GROUP_CONCAT(DISTINCT ?surfaceForm ; separator = "|") AS ?surfaceForms)
WHERE {
  {
    SELECT ?subject
    WHERE {
      {
        SELECT ?subject (COUNT(?link) AS ?inDegree)
        WHERE {
          GRAPH <http://cs.dbpedia.org> {
            VALUES ?class {
              {{#classes}}
              <{{{.}}}>
              {{/classes}}
            }
            ?subject a ?class .
            ?link dbo:wikiPageWikiLink ?subject .
          }
        }
        GROUP BY ?subject
        ORDER BY DESC(?inDegree)
      }
    }
    OFFSET {{offset}}
    LIMIT 1000
  }
  GRAPH <http://cs.dbpedia.org> {
    ?subject rdfs:label ?_label ;
      dbo:abstract ?_description .
    FILTER (!REGEX(?_label, "^(\\p{Lu}\\.?)+$") {{! Filter out abbreviations, such as "R.E.M.". }}
            &&
            !REGEX(?_label, "^.*\\d+.*$") {{! Eliminate digits }}
            &&
            (STRLEN(?_description) > 140) {{! Get only resources with longer descriptions. }} 
            &&
            langMatches(lang(?_label), "cs")
            &&
            langMatches(lang(?_description), "cs")
            &&
            (STRLEN(?_label) < 40)) {{! Eliminate too long labels. }} 
    VALUES ?surfaceFormProperty {
      csdb:name
      csdb:název
      csdb:příjmení
      dbo:birthName
      dbo:wikiPageWikiLinkText
      dcterms:title
    }
    OPTIONAL {
      ?subject ?surfaceFormProperty ?surfaceForm .
      {{! Prevent empty surface forms }}
      FILTER (isLiteral(?surfaceForm)
              &&
              STRLEN(STR(?surfaceForm)) > 2
              &&
              !regex(STR(?surfaceForm), "^\\s+$"))
{'fraction_non_alphanumeric': 0.15292652552926525, 'fraction_numerical': 0.008468244084682441, 'mean_word_length': 1.8441926345609065, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1550554', 'n_tokens_mistral': 1381, 'n_tokens_neox': 1281, 'n_words': 254}