SWCLOS: A Semantic Web Reasoner on CLOS

NTriple Subsystem



File NTriple\ntparser.cl

find-package-from-documentation resource [function]

find-package-from-uri resource [function]

label-localpart symbol [function]

label-prefix symbol [function]

label-uri symbol [function]

escaped-p str pos [function]

position-with-escape char str i [function]

find-with-escape char str i [function]

ws-p char [function]

ws ::= space | tab

eoln-p char [function]

eoln ::= cr | lf | cr lf

character-p char [function]

character ::= [#x20-#x7E] /* US-ASCII space to decimal 126 */

name-char-p char [function]

lower-name-char-p char [function]

skip-ws str i [function]

name-p str i [function]

parse-name str i [function]

name ::= [A-Za-z][A-Za-z0-9]*

QName-p str i [function]

parse-QName str i [function]

name&space QName [function]

ID-p str i [function]

parse-nodeID str i [function]

nodeID ::= '_:' name

language-p str i [function]

language ::= [a-z]+ ('-' [a-z0-9]+ )*

%language-p str i [function]

parse-language str i [function]

uriref-p str i [function]

uriref ::= '' absoluteURI ''

parse-iriref str i [function]

uriref ::= '' absoluteURI ''

langString-p str i [function]

langString ::= '"' string '"' ( '@' language )?

parse-langString str i [function]

langString ::= '"' string '"' ( '@' language )?

datatypeString-p str i [function]

datatypeString ::= '

parse-datatypeString str i [function]

datatypeString ::= '

literal-p str i [function]

parse-literal str i [function]

literal ::= langString | datatypeString

object-p str i [function]

object ::= uriref | nodeID | literal

parse-object str i [function]

predicate-p str i [function]

predicate ::= uriref

parse-predicate str i [function]

predicate ::= uriref

subject-p str i [function]

subject ::= uriref | nodeID

parse-subject str i [function]

subject ::= uriref | nodeID

parse-triple str i [function]

triple ::= subject ws+ predicate ws+ object ws* '.' ws*

nt-comment-p str i [function]

parse-nt-comment str i [function]

comment ::= '#' ( character - ( cr | lf ) )*

parse-triple-line line [function]

line ::= ws* ( comment | triple )? eoln

read-ntripleDoc stream process-fn [function]

ntripleDoc ::= line*

ask-user-nt-file [function]

read-NTriple-file process-fn &optional file code [function]

rdf-parser-test subject predicate object [function]


File NTriple\ntriple.cl

N-triple module

IT Program Project in Japan: Building Operation-Support System for Large-scale System using IT

Copyright © 2003 by Galaxy Express Corporation


defTriple

defTriple subject predicate object [macro]

defines a triple with forward-reference functionality.

/. subject predicate object [macro]

defines a triple with forward-reference functionality.

./ subject predicate object [macro]

defines a triple with forward-reference functionality.

Add Triple

addTriple shows very convenient usage of method. A triple of subject/predicate/object in various types, which may be undefined in forward reference, are accepted and they are set up step by step using appropriate entailment rules piecewisely.


        +-- t/URI/t
        +-- t/sym/t
        +-- URI/t/t
        |                                   +-- sym/rdf:type/sym
        |                                   +-- sym/rdf:type/cls
        +-- sym/rsc/t                       +-- sym/rdfs:subPropertyOf/sym
 t/t/t -+-- sym/prop/t --+-- sym/prop/sym --+-- sym/rdfs:subPropertyOf/prop
        |                +-- sym/prop/data  +-- sym/rdfs:subClassOf/sym
        |                                   +-- sym/rdfs:subClassOf/cls
        |
        +-- rsc/prop/t --+-- rsc/prop/sym
        |                +-- cls/prop/t ---+-- cls/prop/sym 
        |                                  +--------------------- cls/rdfs:subClassOf/cls
        +-- rsc/rsc/t

addTriple subject predicate object [function]

adds a subject-predicate-object triple.

t rdf:type t

addTriple subject (predicate (eql type)) object [method]

Class rdf:type Class --> Class rdf:type Class

addTriple (subject Class) (predicate (eql type)) (object Class) [method]

Resource rdf:type Class --> Resource rdf:type Class

addTriple (subject Resource) (predicate (eql type)) (object Class) [method]

Resource rdf:type t --> Resource rdf:type Resource

addTriple (subject Resource) (predicate (eql type)) object [method]

addTriple (subject Resource) (predicate (eql type)) (object Resource) [method]

symbol rdf:type t --> Resource rdf:type t

addTriple (subject symbol) (predicate (eql type)) object [method]

t rdf:type symbol --> t rdf:type Class

Range constraint is used for proactive entailment for undefined symbol. See entaiment rule rdfs3.

addTriple subject (predicate (eql type)) (object symbol) [method]

t rdf:type iri --> t rdf:type Class

addTriple subject (predicate (eql type)) (object iri) [method]

symbol rdf:type Class

addTriple (subject symbol) (predicate (eql type)) (object Class) [method]

This form is turned out to an addClass form, due to predicate rdf:type.

iri rdf:type Class

addTriple (subject iri) (predicate (eql type)) (object Class) [method]

This form is turned out to an addClass form, due to predicate rdf:type. subject as iri is stored into rdf:about slot.

t rdfs:subClassOf t

addTriple subject (predicate (eql subClassOf)) object [method]

Class rdfs:subClassOf Class

superclasses-of (object Class) [method]

subclasses-of (object Class) [method]

addTriple (subject Class) (predicate (eql subClassOf)) (object Class) [method]

Resource rdfs:subClassOf Resource --> Class rdfs:subClassOf Class

addTriple (subject Resource) (predicate (eql subClassOf)) (object Resource) [method]

symbol rdfs:subClassOf Resource --> Class rdfs:subClassOf Resource

addTriple (subject symbol) (predicate (eql subClassOf)) (object Class) [method]

iri rdfs:subClassOf Resource --> Class rdfs:subClassOf Resource

addTriple (subject iri) (predicate (eql subClassOf)) (object Class) [method]

symbol rdfs:subClassOf symbol --> symbol rdfs:subClassOf Class

addTriple (subject symbol) (predicate (eql subClassOf)) (object symbol) [method]

iri rdfs:subClassOf iri --> iri rdfs:subClassOf Class

addTriple (subject iri) (predicate (eql subClassOf)) (object iri) [method]

t rdfs:subPropertyOf t

addTriple subject (predicate (eql subPropertyOf)) object [method]

Property rdfs:subPropertyOf Property

strict-abst-property-p abst spec [function]

most-specific-property absts [function]

addTriple (subject Property) (predicate (eql subPropertyOf)) (object Property) [method]

symbol rdfs:subPropertyOf Property --> Resource rdfs:subPropertyOf Property

addTriple (subject symbol) (predicate (eql subPropertyOf)) (object Property) [method]

iri rdfs:subPropertyOf Property --> Resource rdfs:subPropertyOf Property

addTriple (subject iri) (predicate (eql subPropertyOf)) (object Property) [method]

symbol rdfs:subPropertyOf symbol --> symbol rdfs:subPropertyOf Resource

addTriple (subject symbol) (predicate (eql subPropertyOf)) (object symbol) [method]

Resource Property symbol --> Resource Property Resource

addTriple (subject Resource) (predicate Property) (object symbol) [method]

Resource Property iri --> Resource Property Resource

addTriple (subject Resource) (predicate Property) (object iri) [method]

Resource Property uri --> Resource Property iri

addTriple (subject Resource) (predicate Property) (object uri) [method]

Resource Property t ; intall with domain checking

addTriple (subject Resource) (predicate Property) object [method]

addTriple (subject Resource) (predicate Resource) object [method]

collect-domaind slots [function]

collects domain information from properties in slots.

symbol Property t --> Resource Property t

addTriple (subject symbol) (predicate Property) object [method]

addTriple (subject symbol) (predicate Resource) object [method]

iri Property t --> Resource Property t

addTriple (subject iri) (predicate Property) object [method]

addTriple (subject iri) (predicate Resource) object [method]

symbol Property number --> Resource Property number

addTriple (subject symbol) (predicate Property) (object number) [method]

Domain entailment and range checks.

iri Property number --> Resource Property number

addTriple (subject iri) (predicate Property) (object number) [method]

Domain entailment and range checks.

symbol Property string --> Resource Property string

addTriple (subject symbol) (predicate Property) (object string) [method]

iri Property string --> Resource Property string

addTriple (subject iri) (predicate Property) (object string) [method]

symbol Property symbol --> symbol Property Resource

Range constraint is used for satisfiability checking and proactive entailment. See entaiment rule rdfs3.

addTriple (subject symbol) (predicate Property) (object symbol) [method]

iri Property iri --> iri Property Resource

Domain and range constraint is used for satisfiability checking and proactive entailment. See entaiment rule rdfs3.

addTriple (subject iri) (predicate Property) (object iri) [method]

(quote resource) Property t --> resource Property t

addTriple (subject cons) (predicate Property) object [method]

t Property uri --> t Property iri

addTriple subject (predicate Property) (object uri) [method]

iri symbol t --> iri Property t

If symbol is undefined, entailment rule rdf1 is applied.

addTriple (subject iri) (predicate symbol) object [method]

t symbol t --> t Property t

If symbol is undefined, entailment rule rdf1 is applied.

addTriple subject (predicate symbol) object [method]

t uri t --> t symbol t

addTriple subject (predicate uri) object [method]

iri uri t --> iri symbol t

addTriple (subject iri) (predicate uri) object [method]

uri t t --> iri t t

addTriple (subject uri) predicate object [method]

addTriple (subject symbol) (predicate (eql type)) (object Resource) [method]

addTriple (subject (eql 'string)) predicate object [method]

addTriple (subject (eql 'decimal)) predicate object [method]

addTriple (subject (eql 'float)) predicate object [method]

addTriple (subject (eql 'double)) predicate object [method]

addTriple (subject (eql 'int)) predicate object [method]

addTriple (subject (eql 'integer)) predicate object [method]

addTriple (subject (eql 'long)) predicate object [method]

addTriple (subject (eql 'short)) predicate object [method]

addTriple (subject (eql 'positiveInteger)) predicate object [method]

addTriple (subject (eql 'nonPositiveInteger)) predicate object [method]

addTriple (subject (eql 'negativeInteger)) predicate object [method]

addTriple (subject (eql 'nonNegativeInteger)) predicate object [method]

intern-from-nodeID ID [function]

intern-langString literal [function]

langString ::= '"' string '"' ( '@' language )?

intern-datatypeString literal [function]

datatypeString ::= langString '^^' uriref

intern-literal literal [function]

intern-from-QName QName [function]

addTriple-from-file subject predicate object [function]

intern-subject str [function]

intern-predicate str [function]

intern-object str [function]

get-triple resource [function]


File NTriple\ntwriter.cl

NTWriter module

IT Program Project in Japan: Building Operation-Support System for Large-scale System using IT.

This code is written by Seiji Koide at Galaxy Express Corporation, Japan, for the realization of the MEXT IT Program in Japan,

Copyright © 2004 by Galaxy Express Corporation
Copyright (c) 2008 Seiji Koide


get-triple-uri resource [function]

print-uri-form uri stream [function]

write-triple triple &optional stream [function]

write-nt resource &optional stream [function]


SWCLOS Home Authors Lisp Code Overview