[ Expand All ] [ Collapse All ] - [ Properties (8) ] [ Methods (32) ] - [ Legend ]

N3Parser Class

Object
N3Parser

Class: N3Parser ----------------------------------------------------------------------------------

Properties implemented by N3Parser
public method bNode

public method DAML_NS

public method debug

public method OWL_NS

public method parsedNamespaces

public method parseError

public method RDF_NS

public method Tokens

==================== Variables ====================

Methods implemented by N3Parser
private method applyStuff

PHPapplyStuff(array $prefixes, array $list)

Applies stuff :) Expands namespace prefixes etc.

Arguments

private method array_concat

PHParray_concat(array $a, array $b)

Concatenates two arrays

Arguments

private method bnodeID

PHPbnodeID()

Generates a new node id.

private method doLists

PHPdoLists(array $list, string $schar, string $echar)

Makes lists of elements in list into a seperate array element. e.g. doLists(["a","b","[","c","]","d"], "[","]")=> ["a","b", ["c"], "d"]

Arguments

private method expandLists

PHParray expandLists(array $list)

This makes [ ] lists into bnodes.

Arguments

private method filterWs

PHPfilterWs(array $list)

Removes all whitespace tokens from list

Arguments

private method fixAnon

PHPfixAnon(array $list)

This makes bNodes out of variables like _:a etc.

Arguments

public method generateModel

PHPobject generateModel(unknown $path, boolean $dummy, boolean $model)

Generate a new MemModel from an URI or file.

Arguments

Return

MemModel

private method getObjs

PHPgetObjs(array $list)

Gets a list of triples with same predicate e.g. :Gunnar :likes "Cheese", "Wine".

Arguments

public method getPovs

PHPgetPovs(array $list)

Gets a list of triples with same subject e.g. :Gunnar :firstname "Gunnar" ; :lastname "Grimnes.

Arguments

private method getPrefixes

PHPgetPrefixes(array $list)

Returns an array with prefixes=>namespace mappings

Arguments

private method getSpan

PHParray getSpan(array $list, integer $start, integer $end)

Gets a slice of an array. Returns the wanted slice, as well as the remainder of the array. e.g. getSpan(['p', 'q', 'r'], 1, 2) gives (['q'], ['p', 'r'])

Arguments

private method getStatements

PHPgetStatements(array $list)

Returns an array of triples extracted from the list of n3 tokens

Arguments

private method isWS

PHPisWS(string $s)

==================== Private Methods from here ==================== General list processing functions

Returns FALSE if argument is a whitespace character

Arguments

private method listify

PHPlistify(array $list, integer $start, integer $end)

Returns a list with the elements between start and end as one quoted string e.g. listify(["a","b","c","d"],1,2) => ["a","b c", "d"]

Arguments

private method listStuff

PHPlistStuff(unknown $list)

Apply doLists for all different types of list.

Arguments

constructor N3Parser

PHPN3Parser()

==================== Public Methods ====================

Constructor

private method n3tolist

PHPn3tolist(string $s)

Main work-horse function. This converts a N3 string to a list of statements

Arguments

private method notComment

PHPnotComment(string $s)

Returns true if the string is not a comment

Arguments

public method parse

PHPparse(string $s)

This parses a N3 string and prints out the triples

Arguments

public method parse2model

PHPobject parse2model(string $s, boolean $model)

This parses a N3 string and returns a memmodel

Arguments

Return

Model

private method posns

PHPposns(array $list, string $item)

Returns an array with all indexes where item appears in list

Arguments

private method replace_a_type

PHPreplace_a_type(string $l, unknown $p)

Callback function for replacing "a" elements with the right RDF uri.

Arguments

private method replace_equal

PHPreplace_equal(string $l, unknown $p)

Callback function for replacing "=" elements with the right DAML+OIL uri.

Arguments

private method replace_this

PHPreplace_this(string $l, unknown $p)

Callback function for replacing "this" elements with the right RDF uri.

Arguments

public method setFixBnodes

PHPsetFixBnodes(unknown $set)

Sets, if BlankNode labels should be replaced by the generic label from the constants.php file default is "false" -> the used label in n3 is parsed to the model

Arguments

private method statementize

PHPstatementize(array $list)

Does the real work, returns a list of subject, predicate, object triples.

Arguments

private method str2unicode_nfc

PHPstring str2unicode_nfc(string $str)

converts a string to its unicode NFC form (e.g. \uHHHH or \UHHHHHHHH).

Arguments

private method toke

PHPtoke(string $s)

More N3 specific functions

Returns a list of tokens

Arguments

private method toRDFNode

PHPtoRDFNode(string $s, unknown $state)

Constructs a RAP RDFNode from URI/Literal/Bnode

Arguments

private method trimLine

PHPtrimLine(unknown $l, unknown $i)

Callback function for trimming whitespace from lines

Arguments

public method uparse

PHPuparse(string $s, string $func)

This parses a N3 string and calls func($subject, $predicate, $object) with each trioke

Arguments

Generated by PHPEdit - Copyright © 1999-2004 - Sébastien Hordeaux - WaterProof SARL