<commit_before><!DOCTYPE html>
<html>
  % set vocabs = union(set(graph.subjects(RDF.type, OWL.Ontology)),
                  set(graph.objects(RDFS.isDefinedBy)))
  <head>
    <meta charset="utf-8" />
    <title>${graph.label(list(vocabs)[0])} - Vocab View</title>
    <link rel="stylesheet" href="vocab.css" />
    <link rel="stylesheet" href="graph.css" />
  </head>
  <body>
    % set rclasses = map(graph.resource, sorted(
                  union(set((graph.subjects(RDF.type, RDFS.Class))),
                    set((graph.subjects(RDF.type, OWL.Class))))))
    % set rproperties = map(graph.resource, sorted(
                  union(set(graph.subjects(RDF.type, RDF.Property)),
                    set(graph.subjects(RDF.type, OWL.ObjectProperty)),
                    set(graph.subjects(RDF.type, OWL.DatatypeProperty)))
                ))
    % set DOMAIN = union(SCHEMA.domainIncludes, RDFS.domain)
    % set RANGE = union(SCHEMA.rangeIncludes, RDFS.range)
    <nav>
      <section>
        <b>Classes</b>
        % for rclass in rclasses
        <a href="${link(rclass)}">${rclass.qname()}</a>
        % endfor
      </section>
      <section>
        <b>Properties</b>
        % for rprop in rproperties
        <a href="${link(rprop)}">${rprop.qname()}</a>
        % endfor
      </section>
    </nav>

    <header>
    % for vocab in vocabs
      <h1><a href="${vocab}">
          ${graph.value(vocab, union(DC.title, RDFS.label)) or "&lt;%s>" % vocab}</a>
      </h1>
      <p>${graph.value(vocab, union(DC.description, RDFS.comment))}</p>
    % endfor
    </header>

    % macro itemsblock(items, label, classname, iteminfo=False)
      % set itemlist = sorted(items)
      % if itemlist
        <dt>${label}</dt>
        <dd>
          <ul class="${classname}">
            % for c in itemlist
              % if isinstance(c.identifier, URIRef)
                <li class="${listclass(c)}">
                  <a href="${link(c)}">${c.qname()}</a>
                  % if iteminfo and extgraph
                    ${classinfo(extgraph.resource(c.identifier))}
                  % endif
                </li>
              % endif
            % endfor
          </ul>
        </dd>
      % endif
    % endmacro

    % macro classinfo(rclass, nolabel='')
      <p>
        ${(label(rclass) or nolabel)}
        % if rclass.value(RDFS.comment)
          <em>&mdash; ${(rclass.value(RDFS.comment))}</em>
        % endif
      </p>
    % endmacro

    <section>
      <h1>Classes</h1>
      % for rclass in rclasses
      <div id="${rclass.qname()}" class="class">
        <h2><code>${rclass.qname()}</code></h2>
        ${classinfo(rclass, "...")}
        <dl>
          ${itemsblock(rclass.objects(OWL.equivalentClass), "Equivalent classes", 'baseclasses', True)}
          ${itemsblock(rclass.objects(RDFS.subClassOf), "Base classes", 'baseclasses')}
          ${itemsblock(rclass.subjects(RDFS.subClassOf), "Subclasses", 'subclasses')}
          % set props = sorted(rclass.subjects(DOMAIN))
          % if props
            <dt>Properties</dt>
            <dd>
              <ul class="properties">
                % for prop in props
                <li class="${listclass(prop)}">
                  <a href="${link(prop)}"><code>${prop.qname()}</code></a>
                  % if prop.value(SKOS.notation)
                  <span>(${prop.value(SKOS.notation)})</span>
                  % endif
                  <i>${(label(prop) or '')}</i>
                  % set _range = prop.value(RANGE)
                  % if _range
                  <span>&rarr; <a href="${link(_range)}">${_range.qname()}</a></span>
                  % endif
                  <!--!
                  % for g in prop.objects(VANN.termGroup)
                  <i><a href="${link(g)}">${g.qname()}</a></i>
                  % endfor
                  -->
                </li>
                % endfor
              </ul>
            </dd>
          % endif
          % set rangeprops = sorted(rclass.subjects(RANGE))
          % if rangeprops
            <dt>In range of properties</dt>
            <dd>
            <dd>
              <ul class="properties range-of">
                % for prop in rangeprops
                <li class="${listclass(prop)}">
                  &larr; <a href="${link(prop)}"><code>${prop.qname()}</code></a>
                  % set domain = prop.value(DOMAIN)
                  % if domain
                  <span>&larr; <a href="${link(domain)}">${domain.qname()}</a></span>
                  % endif
                </li>
              % endfor
            </dd>
          % endif
          % if any(rclass.subjects(RDF.type))
          <dt>Instances</dt>
          <dd>
          <ul class="instances">
              % for i in sorted(rclass.subjects(RDF.type))
              <li><a href="${link(i)}">${i.qname()}</a></li>
              % endfor
            </ul>
          </dd>
          % endif
        </dl>
      </div>
      % endfor
    </section>

    <section>
      <h1>Properties</h1>
      % for rprop in rproperties
      <div id="${rprop.qname()}" class="property">
        <h2><code>${rprop.qname()}</code></h2>
        <p>
          ${(label(rprop) or '...')}
          % if rprop.value(RDFS.comment)
            <em>&mdash; ${(rprop.value(RDFS.comment))}</em>
          % endif
        </p>
        <dl>
          ${itemsblock(rprop.objects(OWL.equivalentProperty), "Equivalent properties", 'baseproperties', True)}
          ${itemsblock(rprop.objects(RDFS.subPropertyOf), "Base properties", 'baseproperties')}
          ${itemsblock(rprop.subjects(union(RDFS.subPropertyOf, OWL.equivalentProperty)), "Subproperties", 'subproperties')}
          % set domains = sorted(rprop.objects(DOMAIN))
          % if domains
            <dt>Domain(s)</dt>
            <dd>
              <ul>
                % for c in domains
                <li class="${listclass(c)}">
                  <a href="${link(c)}"><code>${c.qname()}</code></a>
                  <i>${(label(c))}</i>
                </li>
                % endfor
              </ul>
            </dd>
          % endif
          % set ranges = sorted(rprop.objects(RANGE))
          % if ranges
            <dt>Range(s)</dt>
            <dd>
              <ul>
                % for c in ranges
                <li class="${listclass(c)}">
                  <a href="${link(c)}"><code>${c.qname()}</code></a>
                  <i>${(label(c))}</i>
                </li>
                % endfor
              </ul>
            </dd>
          % endif
        </dl>
      </div>
      % endfor<commit_msg>Show inverses in vocabview<commit_after><!DOCTYPE html>
<html>
  % set vocabs = union(set(graph.subjects(RDF.type, OWL.Ontology)),
                  set(graph.objects(RDFS.isDefinedBy)))
  <head>
    <meta charset="utf-8" />
    <title>${graph.label(list(vocabs)[0])} - Vocab View</title>
    <link rel="stylesheet" href="vocab.css" />
    <link rel="stylesheet" href="graph.css" />
  </head>
  <body>
    % set rclasses = map(graph.resource, sorted(
                  union(set((graph.subjects(RDF.type, RDFS.Class))),
                    set((graph.subjects(RDF.type, OWL.Class))))))
    % set rproperties = map(graph.resource, sorted(
                  union(set(graph.subjects(RDF.type, RDF.Property)),
                    set(graph.subjects(RDF.type, OWL.ObjectProperty)),
                    set(graph.subjects(RDF.type, OWL.DatatypeProperty)))
                ))
    % set DOMAIN = union(SCHEMA.domainIncludes, RDFS.domain)
    % set RANGE = union(SCHEMA.rangeIncludes, RDFS.range)
    <nav>
      <section>
        <b>Classes</b>
        % for rclass in rclasses
        <a href="${link(rclass)}">${rclass.qname()}</a>
        % endfor
      </section>
      <section>
        <b>Properties</b>
        % for rprop in rproperties
        <a href="${link(rprop)}">${rprop.qname()}</a>
        % endfor
      </section>
    </nav>

    <header>
    % for vocab in vocabs
      <h1><a href="${vocab}">
          ${graph.value(vocab, union(DC.title, RDFS.label)) or "&lt;%s>" % vocab}</a>
      </h1>
      <p>${graph.value(vocab, union(DC.description, RDFS.comment))}</p>
    % endfor
    </header>

    % macro itemsblock(items, label, classname, iteminfo=False)
      % set itemlist = sorted(items)
      % if itemlist
        <dt>${label}</dt>
        <dd>
          <ul class="${classname}">
            % for c in itemlist
              % if isinstance(c.identifier, URIRef)
                <li class="${listclass(c)}">
                  <a href="${link(c)}">${c.qname()}</a>
                  % if iteminfo and extgraph
                    ${classinfo(extgraph.resource(c.identifier))}
                  % endif
                </li>
              % endif
            % endfor
          </ul>
        </dd>
      % endif
    % endmacro

    % macro classinfo(rclass, nolabel='')
      <p>
        ${(label(rclass) or nolabel)}
        % if rclass.value(RDFS.comment)
          <em>&mdash; ${(rclass.value(RDFS.comment))}</em>
        % endif
      </p>
    % endmacro

    <section>
      <h1>Classes</h1>
      % for rclass in rclasses
      <div id="${rclass.qname()}" class="class">
        <h2><code>${rclass.qname()}</code></h2>
        ${classinfo(rclass, "...")}
        <dl>
          ${itemsblock(rclass.objects(OWL.equivalentClass), "Equivalent classes", 'baseclasses', True)}
          ${itemsblock(rclass.objects(RDFS.subClassOf), "Base classes", 'baseclasses')}
          ${itemsblock(rclass.subjects(RDFS.subClassOf), "Subclasses", 'subclasses')}
          % set props = sorted(rclass.subjects(DOMAIN))
          % if props
            <dt>Properties</dt>
            <dd>
              <ul class="properties">
                % for prop in props
                <li class="${listclass(prop)}">
                  <a href="${link(prop)}"><code>${prop.qname()}</code></a>
                  % if prop.value(SKOS.notation)
                  <span>(${prop.value(SKOS.notation)})</span>
                  % endif
                  <i>${(label(prop) or '')}</i>
                  % set _range = prop.value(RANGE)
                  % if _range
                  <span>&rarr; <a href="${link(_range)}">${_range.qname()}</a></span>
                  % endif
                  <!--!
                  % for g in prop.objects(VANN.termGroup)
                  <i><a href="${link(g)}">${g.qname()}</a></i>
                  % endfor
                  -->
                </li>
                % endfor
              </ul>
            </dd>
          % endif
          % set rangeprops = sorted(rclass.subjects(RANGE))
          % if rangeprops
            <dt>In range of properties</dt>
            <dd>
            <dd>
              <ul class="properties range-of">
                % for prop in rangeprops
                <li class="${listclass(prop)}">
                  &larr; <a href="${link(prop)}"><code>${prop.qname()}</code></a>
                  % set domain = prop.value(DOMAIN)
                  % if domain
                  <span>&larr; <a href="${link(domain)}">${domain.qname()}</a></span>
                  % endif
                </li>
              % endfor
            </dd>
          % endif
          % if any(rclass.subjects(RDF.type))
          <dt>Instances</dt>
          <dd>
          <ul class="instances">
              % for i in sorted(rclass.subjects(RDF.type))
              <li><a href="${link(i)}">${i.qname()}</a></li>
              % endfor
            </ul>
          </dd>
          % endif
        </dl>
      </div>
      % endfor
    </section>

    <section>
      <h1>Properties</h1>
      % for rprop in rproperties
      <div id="${rprop.qname()}" class="property">
        <h2><code>${rprop.qname()}</code></h2>
        <p>
          ${(label(rprop) or '...')}
          % if rprop.value(RDFS.comment)
            <em>&mdash; ${(rprop.value(RDFS.comment))}</em>
          % endif
        </p>
        <dl>
          ${itemsblock(rprop.objects(OWL.equivalentProperty), "Equivalent properties", 'baseproperties', True)}
          ${itemsblock(rprop.objects(RDFS.subPropertyOf), "Base properties", 'baseproperties')}
          ${itemsblock(rprop.subjects(union(RDFS.subPropertyOf, OWL.equivalentProperty)), "Subproperties", 'subproperties')}
          % set inverse = rprop.value(OWL.inverseOf)
          % if inverse
            <dt>Inverse of</dt>
            <dd>
              <a href="${link(inverse)}"><code>${inverse.qname()}</code></a>
              <i>${(label(inverse) or '')}</i>
            </dd>
          % endif
          % set domains = sorted(rprop.objects(DOMAIN))
          % if domains
            <dt>Domain(s)</dt>
            <dd>
              <ul>
                % for c in domains
                <li class="${listclass(c)}">
                  <a href="${link(c)}"><code>${c.qname()}</code></a>
                  <i>${(label(c) or '')}</i>
                </li>
                % endfor
              </ul>
            </dd>
          % endif
          % set ranges = sorted(rprop.objects(RANGE))
          % if ranges
            <dt>Range(s)</dt>
            <dd>
              <ul>
                % for c in ranges
                <li class="${listclass(c)}">
                  <a href="${link(c)}"><code>${c.qname()}</code></a>
                  <i>${(label(c) or '')}</i>
                </li>
                % endfor
              </ul>
            </dd>
          % endif
        </dl>
      </div>
      % endfor
{'fraction_non_alphanumeric': 0.17355249518732416, 'fraction_numerical': 0.001776988005330964, 'mean_word_length': 1.5260893959229473, 'pattern_counts': {'":': 0, '<': 317, '<?xml version=': 0, '>': 319, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5377269', 'n_tokens_mistral': 4346, 'n_tokens_neox': 4159, 'n_words': 713}