{
    "outgoing" : {{'''
    select distinct ?property ?range where {
      {
        ?e a ?type.
      } union {
        ?e ?p ?o.
        ?p rdfs:domain|<http://purl.org/dc/dcam/domainIncludes>|schema:domainIncludes ?type.
      } union {
        ?s ?p ?e.
        ?p rdfs:range|<http://purl.org/dc/dcam/rangeIncludes>|schema:rangeIncludes ?type.
      }
      ?type (rdfs:subClassOf|owl:equivalentClass)* ?mid.
      ?mid (rdfs:subClassOf|owl:equivalentClass)* ?class.
      {
          ?p rdfs:subPropertyOf* ?property.
          ?property rdfs:domain|<http://purl.org/dc/dcam/domainIncludes>|schema:domainIncludes ?class.
          optional {
              ?property rdfs:range|<http://purl.org/dc/dcam/rangeIncludes>|schema:rangeIncludes ?range.
          }
      }
      minus { ?property a owl:DatatypeProperty. }
    }''' | query(values={"e":this.identifier}) | iter_labelize(key="property", label_key="label") | iter_labelize(key="range", label_key="range_label") | tojson }},
    "incoming" : {{'''
    select distinct ?property ?domain where {
      {
        ?e a ?type.
      } union {
        ?e ?p ?o.
        ?p rdfs:domain|<http://purl.org/dc/dcam/domainIncludes>|schema:domainIncludes ?type.
      } union {
        ?s ?p ?e.
        ?p rdfs:range|<http://purl.org/dc/dcam/rangeIncludes>|schema:rangeIncludes ?type.
      }
      ?type (rdfs:subClassOf|owl:equivalentClass)* ?mid.
      ?mid (rdfs:subClassOf|owl:equivalentClass)* ?class.
      {
          ?p rdfs:subPropertyOf* ?property.
          ?property rdfs:range|<http://purl.org/dc/dcam/rangeIncludes>|schema:rangeIncludes ?class.
          optional {
              ?property rdfs:domain|<http://purl.org/dc/dcam/domainIncludes>|schema:domainIncludes ?domain.
          }
      }
      minus { ?property a owl:DatatypeProperty. }
    }''' | query(values={"e":this.identifier}) | iter_labelize(key="property", label_key="label") | iter_labelize(key="domain", label_key="domain_label") | tojson }}

}
