Highlighting examples

Select highlight.js theme:

PIE

    
Prefices
{ /* useful */
    rdf  :  http://www.w3.org/1999/02/22-rdf-syntax-ns#
}

Axioms
{ // builtin facts
    <rdf:first>     <rdf:type> <rdf:Property>
}

Rules {
  Id: owl_FunctProp
    p  <rdf:type>  <owl:FunctionalProperty>
    x  p  y       [Constraint y != z, p != <rdf:type>]
    x  p  z       [Constraint z != y] [Cut]
    -------------------------------
    y  <owl:sameAs>  z

  Id: ruleWithLiterals
    x <ex:priority> "100"^^xsd:decimal
    ----------------------------------
    x <ex:important> "true"^^xsd:boolean
    
  Consistency: sameAs_with_differentFrom_is_forbidden
    x owl:sameAs y
    x owl:differentFrom y
    ---------------------

  Consistency: checkDomain
    x  p  y
    p  <rdfs:domain>  c
    -----------------
    x  <rdf:type>  c
}
    
    

Sparql

    
# SPARQL comment
PREFIX data: <http://example.com/foaf/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?mbox ?nick ?ppd
FROM NAMED <http://example.org/foaf/aliceFoaf>
FROM NAMED <http://example.org/foaf/bobFoaf>
WHERE {
  GRAPH data:aliceFoaf {
    ?alice  foaf:mbox <mailto:alice@work.example>;
            foaf:knows ?whom .
    ?whom   foaf:mbox ?mbox ;
            rdfs:seeAlso ?ppd .
    ?ppd    a foaf:PersonaProfileDocument .
  }
  GRAPH ?ppd {
    ?w  foaf:mbox ?mbox ;
        foaf:nick ?nick
  }
}

SELECT ?test
FROM NAMED <http://something.com/rdf/thing>;

SELECT ?P (COUNT(?O) AS ?C)
WHERE { ?S ?P ?O }
GROUP BY ?P
HAVING (COUNT(?O) > 2 )

prefix es:   <http://www.ontotext.com/connectors/elasticsearch#>
prefix inst: <http://www.ontotext.com/connectors/elasticsearch/instance#>
insert data {
  inst:entity-person es:createConnector """ {
    "elasticsearchNode": "localhost:9300",
    "types": ["http://www.ontotext.com/example#Document"],
    "fields": [{
      "fieldName": "person",
      "propertyChain": ["http://factforge.net/ff2016-mapping/mentionsEntity", "http://www.w3.org/2000/01/rdf-schema#label"]
    }],
    "entityFilter": "bound(parent(?person) -> type) && parent(?person) -> type in (<http://dbpedia.org/ontology/Person>)"
  } """
}

prefix inst: <http://www.ontotext.com/connectors/elasticsearch/instance#>
select ?name ?key ?count {
  ?search a inst:date-connector;
    :query ''' {"aggs": {"weekly bucket": {"date_histogram" : {
        "field" : "date",
        "interval" : "week",
        "format" : "yyyy-MM-dd"
    }}}} '''
}
    
    

Turtle

    
@base <http://example.org/> .
@prefix : <http://example.org/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rel: <http://www.perceive.net/schemas/relationship/> .
@prefix ff-map:  <http://factforge.net/ff2016-mapping/>.

<#green-goblin>
    rel:enemyOf <#spiderman> ;
    a foaf:Person ; # in the context of the Marvel universe
    foaf:description """Long TRIPLE_QUOTE_STRING with ''' embedded
    apostrophes '''""",
    '''The librarian said, "Perhaps you would enjoy 'War and Peace'."'''.

<#spiderman> rel:enemyOf <#green-goblin> ;
    foaf:name "Spiderman"@en, "Человек-паук"@ru ;
    foaf:age "23"^^xsd:integer, 23;
    foaf:height 1.68, 0.168e1, "1.68"^^xsd:decimal, true, false;
    foaf:mbox  <mailto:alice@example.org>;
    rdfs:label 'chat'@fr, 

_:blank1 fb:object.type fb:object.type.car. # trailing dot not part of symbol
: rel:weird :bar, rel: ; rel:weird rel:.

</doc#char=10,20> ff-map:mentionsEntity </entity>.