PHP Notation3 Parser
This parser can parse a subset of n3, reporting triples to a callback function or constructing a RAP Model ( http://www.wiwiss.fu-berlin.de/suhl/bizer/rdfapi )
Supported N3 features:
This parser is based on n3.py from Epp released 2nd March, 2002. by Sean B. Palmer ( http://infomesh.net/2002/eep/20020302-013802/n3.py )
This parser is released under the GNU GPL license. ( http://www.gnu.org/licenses/gpl.txt )
Located in /syntax/N3Parser.php (line 44)
Object | --N3Parser
Applies stuff :) Expands namespace prefixes etc.
Concatenates two arrays
Makes lists of elements in list into a seperate array element.
e.g. doLists(["a","b","[","c","]","d"], "[","]")=> ["a","b", ["c"], "d"]
This makes [ ] lists into bnodes.
This makes bNodes out of variables like _:a etc.
Generate a new MemModel from an URI or file.
Gets a list of triples with same predicate e.g. :Gunnar :likes "Cheese", "Wine".
Gets a list of triples with same subject e.g. :Gunnar :firstname "Gunnar" ; :lastname "Grimnes.
Returns an array with prefixes=>namespace mappings
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'])
Returns an array of triples extracted from the list of n3 tokens
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"]
Main work-horse function. This converts a N3 string to a list of statements
Returns true if the string is not a comment
This parses a N3 string and prints out the triples
This parses a N3 string and returns a memmodel
Returns an array with all indexes where item appears in list
Callback function for replacing "a" elements with the right RDF uri.
Callback function for replacing "=" elements with the right DAML+OIL uri.
Callback function for replacing "this" elements with the right RDF uri.
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
Does the real work, returns a list of subject, predicate, object triples.
converts a string to its unicode NFC form (e.g. \uHHHH or \UHHHHHHHH).
Constructs a RAP RDFNode from URI/Literal/Bnode
This parses a N3 string and calls func($subject, $predicate, $object) with each trioke
Inherited From Object
Object::toString()
Documentation generated on Mon, 26 Jun 2006 14:25:41 +0200 by phpDocumentor 1.3.0RC6