LICENSE
The contents of the Extended Document Object Model files are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this files except in compliance with the License. You may obtain a copy of the License at "http://www.mozilla.org/MPL/"
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
The Original Code is "Rdf_1_1.pas".
The Initial Developer of the Original Code is Dieter Köhler (Heidelberg, Germany, "http://www.philo.de/"). Portions created by the Initial Developer are Copyright (C) 2003-2010 Dieter Köhler. All Rights Reserved.
Alternatively, the contents of this files may be used under the terms of the GNU General Public License Version 2 or later (the "GPL"), in which case the provisions of the GPL are applicable instead of those above. If you wish to allow use of your version of this files only under the terms of the GPL, and not to allow others to use your version of this files under the terms of the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of any one of the MPL or the GPL.
2010
Table of Contents
The RDF Core Library is under permanent development. The latest version of this Software can be obtained via the Open RDF web-site at "http://www.philo.de/rdf/". The preferred way to contact the author is via the Open RDF mailing list. Instructions how to join the mailing list can be found at "http://www.philo.de/rdf/" as well.
TRdfReferenceType = (rtNone, rtGlobal, rtLocal);
Constants internally used in TRdfGraph.
TRdfStmtAttr = (saSubject, saPredicate, saObject, saObjectLexical, saObjectLanguage, saObjectDatatype);
Constants used to distinguish between different elements of an RDF statement.
TRdfSortType = (stNone, stSPO, stSOP, stPSO, stPOS, stOSP, stOPS);
Constants used to specify the order of the statement in an RDF graph. 'S' means 'Subject', 'P' means 'Predicate', and 'O' means 'Object'. So for example the sort type stPSO specifies that the statements are ordered first according to their predicates, statements with the same predicate are then ordered according to their subjects, and statements with both, equivalent predicate and subject, are order according to their objects.
TRdfFilterStatementEvent = procedure(Sender: TObject; RdfSubject, RdfPredicate, RdfObject, RdfObjectLexical, RdfObjectLanguage, RdfObjectDatatype: UTF8String; var Accept: Boolean) of object;
TRdfFilterStringEvent = procedure(Sender: TObject; var S: string; var Accept: Boolean) of object;
TRdfStatement represents a single RDF statement
property Object_Datatype: UTF8String (readonly)
The datatype of the object if this statement has a literal object, or an empty string otherwise.
property Object_Language: UTF8String (readonly)
The language of the object if this statement has a literal object, or an empty string otherwise.
property Object_Lexical: UTF8String (readonly)
The lexical of the object if this statement has a literal object, or an empty string otherwise.
property Object_Reference: UTF8String (readonly)
The object URI of this statement, or an empty string if this statement has a literal object.
property Owner: TObject (readonly)
The owner object (typically a TRdfGraph object) of this TRdfStatement object.
property Predicate_Reference: UTF8String (readonly)
The predicate URI of this statement.
property Subject_Reference: UTF8String (readonly)
The subject URI of this statement.
constructor Create(AOwner
: TObject;ASubject_Reference
,APredicate_Reference
,AObject_Reference
,AObject_Lexical
,AObject_Language
,AObject_Datatype
: UTF8String);
Creates a new TRdfStatement statement.
AOwner
specifies the owner object which is responsible for freeing this TRdfStatement object. The other parameters specify the properties of the RDF statement (for details see the description of the public properties).
procedure Assign(Source
: TPersistent); override;
Copies the properties of another TRdfStatement object.
function GetAttribute(Kind
: TRdfStmtAttr): UTF8String;
Returns the property of the RDF statement which is indicated by the Kind
parameter.
TRdfCustomFilter is the abstract base class of TRdfUriFilter and TRdfObjectFilter.
TRdfUriFilter is a filter for URI's enclosed in angular brackets, i.e. of the form <URI>.
property Qualifier: string
A filter expression of the form <uri>, where uri contains only characters allowed in URIs (see [RFC 2396]). No complete URI syntax check is performed.
function Match(AUri
: UTF8String): Boolean; virtual;
Tests whether the specified URI matches the filter specified in the Qualifier property. The function returns 'true' if the specified URI matches the Qualifier character by character (including the leading '<' and trailing '>') or if the Qualifier is '*' or '<*>'; otherwise 'false' is returned.
TRdfObjectFilter is a filter for the complex object structure of an RDF statement.
property Qualifier: string
If the Qualifier is '*' the filter matches any object structure. If the Qualifier is '<*>' it matches any object URI of the form '<uri>'. If the Qualifier is '<uri>' it matches the object URI of the form '<uri>' which is character by character identical with it.
To match a particular literal object the Qualifier must have the form '"lexical" @language <datatypeQualifier>'; the quotation marks (") surrounding the lexical are mandatory, the other elements are optional. If the filter lexical is '\*' it matches any object lexical. If the datatype lexical is '<*>' it matches any object datatype.
function Match(AObjectUri
,AObjectLexical
,AObjectLanguage
,AObjectDatatype
: UTF8String): Boolean; virtual;
Tests whether the specified statement object matches the filter specified in the Qualifier property. The function returns 'true' if the specified statement object matches the Qualifier, otherwise 'false' is returned.
TRdfStatementFilter is a filter for RDF statements.
property Enabled: Boolean
If Enabled is 'false' calling the match function returns always 'true'.
property ObjectQualifier: string
The filter statement the object of an RDF statement must match. See the description of the Qualifier property of the TRdfObjectFilter class for details.
property PredicateQualifier: string
The filter statement the predicate of an RDF statement must match. See the description of the Qualifier property of the TRdfUriFilter class for details.
property RejectAll: Boolean
If RejectAll is 'true' and Enabled is 'false' calling the match function returns always 'false'.
property SubjectQualifier: string
The filter statement the subject of an RDF statement must match. See the description of the Qualifier property of the TRdfUriFilter class for details.
procedure Assign(Source
: TPersistent); override;
Copies the properties of another TRdfStatementFilter object.
function Match(ASubject
,APredicate
,AObject
,AObjectLexical
,AObjectLanguage
,AObjectDatatype
: UTF8String): Boolean; virtual;
If Enabled is 'false' calling this function returns 'true'. Otherwise and if RejectAll is 'true' calling this function returns 'false'. Otherwise calling this function tests whether the specified statement matches the filters specified in the SubjectQualifier, PredicateQualifier, and ObjectQualifier properties. The function returns 'true' if the specified statement object matches all qualifiers, otherwise 'false' is returned.
Due to havy work load, a detailed description of the RDF graph classes has been postponed to a future edition of this documentation. Meanwhile, experiment with the example applications.
TRdfGraph is the common ancestor of all RDF graph classes. Do not use this class directly in your own applications. Instead use one of the derived classes or derive your own specialized RDF graph class from TRdfGraph.
TRdfCustomFilteredGraph is the common ancestor of all RDF graph classes which provide automatic filtering. Do not use this class directly in your own applications. Instead use one of the derived classes or derive your own specialized RDF graph class from TRdfCustomFilteredGraph.
TRdfFilteredGraph maintains a list of RDF statements. It publishes a filter object and an OnFilterStatement event which can be used to reject statements of certain kinds. TRdfFilteredGraph components can be connected to TUtilsCustomIteratorAliases components to provide automatic aliases when querying statement attributes such as a statement's subject URI, etc.
TRdfCustomDetailGraph is the common ancestor of all RDF detail graph classes which provide automatic filtering of an associated RDF graph. Do not use this class directly in your own applications. Instead use one of the derived classes or derive your own specialized RDF graph class from TRdfCustomDetailGraph.
TRdfDetailGraph maintains a list of RDF statements automatically generated from the RDF statements of another associated RDF graph. It publishes a filter object and an OnFilterStatement event which can be used to reject statements of certain kinds. TRdfDetailGraph components can be connected to TUtilsCustomIteratorAliases components to provide automatic aliases when querying statement attributes such as a statement's subject URI, etc.
TRdfCustomRestricterGraph is the common ancestor of all RDF restricted graph classes which provide automatic advanced filtering of an associated RDF graph. Do not use this class directly in your own applications. Instead use one of the derived classes or derive your own specialized RDF graph class from TRdfCustomRestricterGraph.
TRdfRestricterGraph maintains a list of RDF statements automatically generated from the RDF statements of another associated RDF graph. It publishes a filter object and an OnFilterStatement event which can be used to reject statements of certain kinds. Additional filters can be applied via the SubjectRestricter
, PredicateRestricter
, and ObjectRestricter
properties. TRdfRestricterGraph components can be connected to TUtilsCustomIteratorAliases components to provide automatic aliases when querying statement attributes such as a statement's subject URI, etc.
TRdfGraphIterator is an iterator class for TRdfGraph (or descendant) objects. It inherits from TUtilsCustomIterator defined in the AutoListUtils unit. For a description of TRdfGraphIterator's inherited properties and methods see the manual of the AutoListUtils unit.
property RdfGraph: TRdfGraph
The TRdfGraph (or descendant) object associated with this iterator.
property RdfSubject: UTF8String (readonly)
The subject of the RDF statement at the current position of the iterator. If no such information is available an empty UTF8String is returned.
property RdfPredicate: UTF8String (readonly)
The predicate of the RDF statement at the current position of the iterator. If no such information is available an empty UTF8String is returned.
property RdfObject: UTF8String (readonly)
The object of the RDF statement at the current position of the iterator. If no such information is available an empty UTF8String is returned.
property RdfObjectLexical: UTF8String (readonly)
The object lexical of the RDF statement at the current position of the iterator. If no such information is available an empty UTF8String is returned.
property RdfObjectLanguage: UTF8String (readonly)
The object language of the RDF statement at the current position of the iterator. If no such information is available an empty UTF8String is returned.
property RdfObjectDatatype: UTF8String (readonly)
The object datatype of the RDF statement at the current position of the iterator. If no such information is available an empty UTF8String is returned.
property CanModify: Boolean (readonly)
Indicates whether the associated RDF graph permits write access to data.
Due to havy work load, a detailed description of the RDF list classes has been postponed to a future edition of this documentation. Meanwhile, experiment with the example applications.
TRdfCustomGraphList is the abstract base class of TRdfGraphList and TRdfResourceList.
An automated string lists, which is synchronized with its associated RDF graph.
TRdfAliases is an alias list class which can automatically interact with any TUtilsCustomIteratorList (or descendant) component. Its list of aliases is also automatically generated from the statements of an associated TRdfGraph (or descendant) component. TRdfAliases inherits from TUtilsCustomIteratorAliases defined in the AutoListUtils unit. For a description of TRdfAliases's inherited properties and methods see the manual of the AutoListUtils unit.
property NameSource: TRdfGraph
Specifies the TRdfGraph (or descendant) object which provides the list of names to be aliased. For each subject appearing in any statement of this TRdfGraph object, the alias list calculates an alias according to the settings of its other properties.
property PredicateSource: TUtilsStringIterator
Specifies a TUtilsStringIterator (or descendant) object whose string at the iterator's position determines the predicate used to built the the list of aliases while evaluating the AliasSource
. If no such iterator is specified the value of the PredicateURI
is used instead.
property PredicateURI: UTF8String
If no iterator is specified in the PredicateSource
property, the PredicateURI
determines the predicate used to built the the list of aliases while evaluating the AliasSource
.
property AliasSource: TRdfGraph
Specifies the TRdfGraph (or descendant) object which provides the name-alias mappings for this alias list. These mappings are determined by the statements of the AliasSource
RDF graph as follows: For each subject appearing in any statement of the NameSource
RDF graph, the first statement in the AliasSource
RDF graph with this subject and whose predicate matches the predicates specified by the PredicateSource
(or the PredicateURI
respectively) is picked out. The subject of this statement determines the name part while the object lexical or (if no object lexical exists) the object reference of this statement determines the alias part of the name-alias pair to be recorded.