rei.n3 4.29 KB
# Reification of N3 (including RDF) in a useful fashion
#
#

@prefix : <http://www.w3.org/2004/06/rei#>.
@prefix rei: <http://www.w3.org/2004/06/swap/rei#>.
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix s: <http://www.w3.org/2000/01/rdf-schema#> .

@keywords is, a, of.

# Each element of the language can be described as a bnode
#
#
#  see why.py, check.py etc

Term a s:Class;
	s:label "term".

BNode s:subClassOf    Term;
	s:label	"blank node".

RDFTerm  s:subClassOf Term.

Symbol s:subClassOf RDFTerm;
	s:label "RDF symbol, identified by a URI".

#:id a rdf:Property; s:label "symbol URI, arbirary or not".
#	a owl:FunctionalProperty, owl:InverseFunctionalProperty;
#	s:comment
#	"""The URI of the symbol is all that is needed to identify it""".
	
uri a rdf:Property; s:label "symbol URI, not arbitray";
	s:comment
	"""The URI of the symbol is all that is needed to identify it.
	This is the name string.""".


Literal s:subClassOf RDFTerm;
	s:label "Literal";
	s:comment
	"""Literals are identified by their string value, their
	datatype (or absence thereof) and their language code
	(or absencethereof). As we are modeling RDF in RDF,
	we can just use a literal the value of a literal.
	""".

value a rdf:Property;
	s:label "Value";
	s:domain :iteral;
#	a owl:DataProperty;
	s:comment """The value of a literal.

	Value is the relation between a node (which happens to be a literal, list etc,..) and the value it takes.""".

Formula s:subClassOf :Term;
	s:label "Formula";
	s:comment 
	"""A formula is identified by an unordered set of statements,
	with a sets of existentially and universally quantified symbols.
	For example, 
		[ :forAll  ( [:uri "ex:#x"] [:uri "ex:#y"]);
		  :forSome ( [:uri "ex:#a"] [:uri "ex:#b"]);
		  :statements ( :s1 :s2 :s3 )
		]
	is equivalent to e.g. in loose math
		forall x,y,x there exists a,b,c such that s1 and s2 and s3
	That is, the universals are always outside the existentials.
	Two formulae are the equal if the contents
	of their forAll, forSome, and statements lists are the same
	irrespective of order.
	Two formulae are equivalent if there is a 1:1 mapping between
	variable names of one and variable names in the other
	which used as subsitution bindings on one gives a formula
	equal to the other.
	""".

RDFGraph s:subClassOf Formula;
	s:comment """A formula which meets the constaints of being
	an RDF Graph as per the RDF spec. No universally qualified variables,
	no nested formulae, no literals as subject, etc.""".
	
universals a rdf:Property;
	s:label "for all";
	s:domain :Formula;
	s:range	 s:Class.

existentials a rdf:Property;
	s:label "for all";
	s:domain :Formula;
	s:range	 s:Class.

statements a rdf:Property;
	s:label "statements";
	s:domain :Formula;
	s:range  s:Class;
	s:comment
	"""The order of the statements is irrelevant.
	They are given as a rdf:List because rdf:Lists exist,
	and we want a closed set.
	""".

Statement a s:Class;
	s:label "Statement";
	s:comment
	"""A statement is the unit of information.
	It expresses a binary relation.
	Its significance is determined by the realtion,
	generally referred to as its predicate.
	""".

subject	 a rdf:Property;
	s:label   "subject";
	s:domain  Statement;
	s:range   Term. # For RDF 1.0, :Symbol

predicate   a rdf:Property;
	s:label   "predicate";
	s:domain  Statement;
	s:range   Term.  # For RDF 1.0,  :Symbol

object    a rdf:Property;
	s:label   "object";
	s:domain  Statement;
	s:range   Term.	# For RDF 1.0, :RDFTerm

# Shortcut properties

subjURI	 a rdf:Property;
	s:label   "subject URI";
	s:comment "Shorhand for subject!uri";
	s:domain  Statement;
	s:range   String. 

predURI   a rdf:Property;
	s:label   "predicate URI";
	s:comment "Shorhand for predicate!uri";
	s:domain  Statement;
	s:range   String.  

objURI    a rdf:Property;
	s:label   "object URI";
	s:comment "Shorhand for object!uri";
	s:domain  Statement;
	s:range   String.

#----
subjValue	  a rdf:Property;
	s:label   "subject value";
	s:comment "Shorhand for subject!Literal. Not in RDF 1.0";
	s:domain  Statement;
	s:range   String. 

predValue          a rdf:Property;
	s:label   "predicate value";
	s:comment "Shorhand for predicate!Literal. Not RDF 1.0.";
	s:domain  Statement;
	s:range   String.  

objValue    a rdf:Property;
	s:label   "object value";
	s:comment "Shorhand for object!Literal";
	s:domain  Statement;
	s:range   String.



#ends