mozdev.org

JSLib
Page Updated: January 22, 2002
Latest Version: 0.1.375
Debug | Install | File I/O | RDF | Network | Sound | Utils | XUL | Zip
Home | Mailing List | Install | Source Code | Downloads | Bugs | docs | clients

RDFFile ( requires rdf.js, file.js )

RDFFile
RDFFile.prototype.setFlags
RDFFile.prototype.setNameSpace
RDFFile.prototype.setID
RDFFile.prototype.load

RDFFile

RDFFile is derived from RDF and takes a path or file url as its first parameter.  It then takes this and checks wether or not the file exist, and creates it if it isn't (optional).

void RDFFile (string aPath, int aFlags, string aNameSpace, string aID)


Constructs an RDF class based on the local file given with aPath and the flags in aFlag.

aPath - a path to the rdf file (you must have permissions).
aFlags (optional) - defines operations, see below.
aNameSpace (optional) - nc for the rdf file (i.e. 'http://jslib.mozdev.org/rdf#') 
aID (optional) - ID used to identify the name space (i.e. "JSLIB").

Possible aFlags values:

Example:
var path = "file:///tmp/foo.rdf";
var ns = "http://www.somenamespace.com/rdf#";
var myID = "SNS";
var gRDF = new RDFFile(path, null, ns, myID);
or using default namespace:
var gRDF = new RDFFile(path);

 or to load the rdf at a later time:

var gRDF = new RDFFile(path, JS_RDFFILE_FLAG_DONT_LOAD );


RDFFile.prototype.setFlags

Sets operational flags.

void setFlags (int aFlags)


Sets flags that define the operation of the class.  These are defined below.

aFlags - defines operations, see below.

Possible aFlags values:

Example:
var gRDF = new RDFFile(path, JS_RDFFILE_FLAG_DONT_LOAD );
gRDF.setFlags(JS_RDFFILE_FLAG_DONT_CREATE
);
gRDF.load();



RDFFile.prototype.setNameSpace

Sets the name space for the rdf file.

void setNameSpace (string aNameSpace)


Sets the name space for the rdf file.  This only has affect if it is a new file that is being created.

aNameSpace - Name space for a newly created rdf file (i.e. "http://jslib.mozdev.org/rdf#").

Example:
var gRDF = new RDFFile(path, JS_RDFFILE_FLAG_DONT_LOAD );
gRDF.setNameSpace("http://jslib.mozdev.org/rdf#" );
gRDF.load();


RDFFile.prototype.setID

Sets the ID for the rdf file.

void setID (string aID)


Sets the ID for the rdf file.  This ID is used to identify the name space in the rdf file (i.e. "JSLIB").

aID - ID used to identify the name space in the rdf file.

Example:
var gRDF = new RDFFile(path , JS_RDFFILE_FLAG_DONT_LOAD);
gRDF.setNameSpace("http://jslib.mozdev.org/rdf#" );
gRDF.setID("JSLIB");
gRDF.load();

RDFFile.prototype.load

Loads the rdf file if not already loaded.

void load ()


Example:
var gRDF = new RDFFile(path , JS_RDFFILE_FLAG_DONT_LOAD);
gRDF.setNameSpace("http://jslib.mozdev.org/rdf#" );
gRDF.setID("JSLIB");
gRDF.load();




The jslib project can be contacted through the mailing list or the member list.
Copyright © 2000-2017. All rights reserved. Terms of Use & Privacy Policy.