Example

RDFS subClassOf

In RDFS the property rdfs:subClassOf is used to state that all the instances of one class are instances of another. In RDF Surfaces, we use simple RDF entailment where this type of entailments must be stated explicitly. The RDF Surfaces graph below states that every City is a Human Community:

# RDF Surfaces translation of:
#  ¬(∃ x: <x rdf:type :City> ∧ ¬(<x rdf:type :HumanCommunity>)) 
# which is equivalent to
#  ∀ x: <x rdf:type :City> → <x rdf:type :HumanCommunity>
(_:x) log:onNegativeSurface {
    _:x rdf:type :City .

    () log:onNegativeSurface {
        _:x rdf:type :HumanCommunity .
    } .
} .
        

We can consult RDF Surfaces graphs by adding some sample data and include a query surface (an eye specific method to query a knowledge graph):

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix : <http://example.org/#>.

# City is a subclass of HumanCommunity
(_:x) log:onNegativeSurface {
    _:x rdf:type :City .

    () log:onNegativeSurface {
        _:x rdf:type :HumanCommunity .
    } .
} .

# Sample data
:Jakarta a :City.

# Query
(_:x _:y) log:onQuerySurface {
    _:x rdf:type _:y .
} .
        

Executing this document using the RDF Surfaces Reasoner should give as result:

@prefix : <http://example.org/#>.

:Jakarta a :City.
:Jakarta a :HumanCommunity. 
    

Acknowledgements

The reasoner is based on the Jos De Roo's eye provided as a web application by Jesse Wright's eyereasoner. RDF Reasoner app is based on Ieben Smessaert's reasoner-app in an adapted version.