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

RDF ( will include rdfContainer.js, rdfBase.js )

RDF
RDF.prototype.getSource

RDF.prototype.getNode

RDF.prototype.addRootSeq
RDF.prototype.addRootAlt
RDF.prototype.addRootBag

RDF.prototype.getRootSeq
RDF.prototype.getRootAlt
RDF.prototype.getRootBag


RDF.prototype.getAllSeqs
RDF.prototype.getAllAlts
RDF.prototype.getAllBags
RDF.prototype.getAllContainers

RDF.prototype.flush


RDF

RDF will open and initialize an rdf datasource.

void RDFFile (string aSrc, int aFlags)


Constructs an RDF class based on the flags in aFlag.

aSrc - a uri to the rdf file.
aFlags (optional) - defines operations, see below.

Possible aFlags values:

Example:
var src = "http://slashdot.org/slashdot.rdf ";

var gRDF = new RDF(src);
or using default namespace:
var gRDF = new RDFFile(src);

 or to load the rdf at a later time:

var gRDF = new RDFFile(path, JS_RDFFILE_FLAG_DONT_LOAD );

  RDF.prototype.getSource

Returns the uri of the created datasource.

uri getSource ()


Example:
var gRDF = new RDFFile(path);
var uri = gRDF.src(
);
dump("uri: " + uri + "\n");


  RDF.prototype.getNode

Get a node from the datasource.

RDFResource getNode (string aPath)


Returns a RDFResource for a give resource path in the rdf graph.

aPath - Resource path of the node.

Example:
var gRDF = new RDFFile(path);
var node = gRDF.getNode("urn:test:bob");
if(node != null) {
    ...  < see RDFResource for operation on nodes >   ...

}


  RDF.prototype.addRootSeq

Get a sequence from the rdf datasource.

RDFContainer addRootSeq (string aPath)


Creates and returns an RDFContainer for a given resource path in the rdf graph.

aPath - Resource path of the container.

Example:
var gRDF = new RDFFile(path );
var seq = gRDF.addRootSeq("urn:test:bob");
if(seq != null) {
    ...  < see RDFContainer for operation on nodes >   ...
}

 

  RDF.prototype.addRootAlt

Get a alt from the rdf datasource.

RDFContainer addRootAlt (string aPath)


Creates and returns an RDFContainer for a given resource path in the rdf graph.

aPath - Resource path of the container.

Example:
var gRDF = new RDFFile(path );
var alt = gRDF.addRootAlt("urn:test:bob");
if(alt != null) {
    ...  < see RDFContainer for operation on nodes >   ...
}


  RDF.prototype.addRootBag

Get a bag from the rdf datasource.

RDFContainer addRootBag (string aPath)


Creates and returns an RDFContainer for a given resource path in the rdf graph.

aPath - Resource path of the container.

Example:
var gRDF = new RDFFile(path );
var bag = gRDF.addRootBag("urn:test:bob");
if(bag != null) {
    ...  < see RDFContainer for operation on nodes >   ...
}


  RDF.prototype.addRootBag

Get a bag from the rdf datasource.

RDFContainer addRootBag (string aPath)


Creates and returns an RDFContainer for a given resource path in the rdf graph.

aPath - Resource path of the container.

Example:
var gRDF = new RDFFile(path );
var bag = gRDF.addRootBag("urn:test:bob");
if(bag != null) {
    ...  < see RDFContainer for operation on nodes >   ...
}


  RDF.prototype.getRootSeq

Get a sequence from the rdf datasource.

RDFContainer getRootSeq (string aPath)


Returns an RDFContainer for a given resource path in the rdf graph.

aPath - Resource path of the container.

Example:
var gRDF = new RDFFile(path );
var seq = gRDF.getRootSeq("urn:test:bob");
if(seq != null) {
    ...  < see RDFContainer for operation on nodes >   ...
}


  RDF.prototype.getRootAlt

Get a alt from the rdf datasource.

RDFContainer getRootAlt (string aPath)


Returns an RDFContainer for a given resource path in the rdf graph.

aPath - Resource path of the container.

Example:
var gRDF = new RDFFile(path);
var alt = gRDF.getRootAlt("urn:test:bob");
if(alt != null) {
    ...  < see RDFContainer for operation on nodes >   ...
}


  RDF.prototype.getRootBag

Get a bag from the rdf datasource.

RDFContainer getRootBag (string aPath)


Returns an RDFContainer for a given resource path in the rdf graph.

aPath - Resource path of the container.

Example:
var gRDF = new RDFFile(path);
var bag = gRDF.getRootBag("urn:test:bob");
if(bag != null) {
    ...  < see RDFContainer for operation on nodes >   ...
}


  RDF.prototype.getRootBag

Get a bag from the rdf datasource.

RDFContainer getRootBag (string aPath)


Returns an RDFContainer for a given resource path in the rdf graph.

aPath - Resource path of the container.

Example:
var gRDF = new RDFFile(path);
var bag = gRDF.getRootBag("urn:test:bob");
if(bag != null) {
    ...  < see RDFContainer for operation on nodes >   ...
}

  RDF.prototype.getAllSeqs

Get all sequences from the rdf datasource.

Array of RDFContainers getAllSeqs ()


Returns an Array of RDFContainers in the rdf graph.

Example:
var gRDF = new RDFFile(path);
var seqs = gRDF.getAllSeqs();
for(var i=0; i<seqs.length; i++) {
    ...  < see RDFContainer for operation on nodes >   ...
}

  RDF.prototype.getAllAlts

Get all alts from the rdf datasource.

Array of RDFContainers getAllAlts ()


Returns an Array of RDFContainers in the rdf graph.

Example:
var gRDF = new RDFFile(path);
var alts = gRDF.getAllAlts();
for(var i=0; i<alts.length; i++) {
    ...  < see RDFContainer for operation on nodes >   ...
}


  RDF.prototype.getAllBags

Get all bags from the rdf datasource.

Array of RDFContainers getAllBags ()


Returns an Array of RDFContainers in the rdf graph.

Example:
var gRDF = new RDFFile(path);
var bags = gRDF.getAllBags();
for(var i=0; i<bags.length; i++) {
    ...  < see RDFContainer for operation on nodes >   ...
}


  RDF.prototype.getAllContainers

Get all containters from the rdf datasource.

Array of RDFContainers getAllContainers ()


Returns an Array of RDFContainers in the rdf graph.

Example:
var gRDF = new RDFFile(path);
var containers = gRDF.getAllContainers();
for(var i=0; i<containers.length; i++) {
    ...  < see RDFContainer for operation on nodes >   ...
}

  RDF.prototype.flush

Flushes the rdf datasource.

void flush ()


Flushes any unsaved data out to the rdf datasource (file in the case of RDFFile).

Example:
var gRDF = new RDFFile(path);
var seq = gRDF.addRootSeq("urn:test:bob");
gRDF.flush();  // save it...



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.