mulgara - semantic store

skip navigation

SHOW SITE NAV
fixed
fluid
straight

Filesystem Models

Filesystem models are special instances of external resolvers that work in conjunction with the internal system model. In this way they are similar to views except that they gather information about files on a local drive instead of models. See the Views section for more information about views.

The capabilities of filesystem models include the ability to:

 

Creating Filesystem Models

You can create filesystem models by:

  1. Using the iTQL create command, creating a model of type http://mulgara.org/mulgara#FileSystemModel. This creates a filesystem model, plus a filesystem definition model.
  2. Loading RDF that represents the directories and files to include or exclude into the filesystem definition model.

Use the drop command to remove a filesystem model.

Note - Ensure that you drop the filesystem model and not the filesystem definition model. Dropping the filesystem model automatically drops the filesystem definition model as well. Dropping the filesystem definition model leaves the filesystem model behind.

 

Updating Filesystem Models

Filesystem models are designed to query for filesystem information. Rather than the entire file system, you might only be interested in specific subsections of the filesystem, and within those subsections, there might be files and directories you want to exclude because they contain irrelevant data.

This include and exclude functionality is provided by the filesystem definition model. Statements specifying the files and directories to include or exclude are loaded into the filesystem definition model using the insert command.

The following example shows how to include a specific directory for your filesystem model (assuming that you have already created a filesystem model called cDrive):

insert $x <http://mulgara.org/mulgara/filesystem#Include> <file:///C:/myDocuments>
into <rmi://mysite.com/server1?def#cDrive>;

Note - Include and exclude statements are inserted into the filesystem definition model. Statements inserted into the main filesystem model are ignored when a query is performed.

The following example shows how to exclude a directory in your filesystem model (assuming that you have already created a filesystem model called cDrive):

insert $x <http://mulgara.org/mulgara/filesystem#Exclude> <file:///C:/myDocuments/spreadsheets>
into <rmi://mysite.com/server1?def#cDrive>;

Note the following points about the include and exclude statements in the filesystem definition model:

 

Querying Filesystem Models

Once the inclusions and exclusions are set up, you can query the filesystem model using the select command, as you would any other model, to generate statements about the files and directories.

The following schema is used for filesystem models:

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xml:base="http://mulgara.org/mulgara"
xml:lang="en">

<rdfs:Class rdf:ID="File"
rdfs:label="file"
rdfs:comment="A file on an operating system">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
</rdfs:Class>

<rdfs:Class rdf:ID="Directory"
rdfs:label="directory"
rdfs:comment="A directory on an operating system">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
</rdfs:Class>

<rdfs:Class rdf:ID="Hidden"
rdfs:label="hidden file"
rdfs:comment="A hidden file on an operating system">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:subClassOf rdf:resource="#File"/>
</rdfs:Class>

<rdfs:Class rdf:ID="ReadOnly"
rdfs:label="read only file"
rdfs:comment="A read only file on an operating system">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:subClassOf rdf:resource="#File"/>
</rdfs:Class>

<rdf:Property rdf:ID="filename"
rdfs:label="filename"
rdfs:comment="Specifies the name of a file">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:domain rdf:resource="#File"/>
<rdfs:domain rdf:resource="#Directory"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</rdf:Property>

<rdf:Property rdf:ID="extension"
rdfs:label="extension"
rdfs:comment="Specifies the extension of a file">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:domain rdf:resource="#File"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</rdf:Property>

<rdf:Property rdf:ID="path"
rdfs:label="path"
rdfs:comment="Specifies the path of a file (as an URI)">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:domain rdf:resource="#File"/>
<rdfs:domain rdf:resource="#Directory"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</rdf:Property>

<rdf:Property rdf:ID="created"
rdfs:label="created"
rdfs:comment="Specifies the creation date of a file">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:domain rdf:resource="#File"/>
<rdfs:domain rdf:resource="#Directory"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime"/>
</rdf:Property>

<rdf:Property rdf:ID="accessed"
rdfs:label="accessed"
rdfs:comment="Specifies the last accessed date of the file">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:domain rdf:resource="#File"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime"/>
</rdf:Property>

<rdf:Property rdf:ID="modified"
rdfs:label="modified"
rdfs:comment="Specifies the last modified date of a file">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:domain rdf:resource="#File"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime"/>
</rdf:Property>

<rdf:Property rdf:ID="parent"
rdfs:label="parent"
rdfs:comment="Specifies the parent directory">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:domain rdf:resource="#File"/>
<rdfs:domain rdf:resource="#Directory"/>
<rdfs:range rdf:resource="http://mulgara.org/mulgara#Directory"/>
</rdf:Property>

<rdf:Property rdf:ID="size"
rdfs:label="size"
rdfs:comment="Specifies the size in bytes of a file">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:domain rdf:resource="#File"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
</rdf:Property>

<rdf:Property rdf:ID="owner"
rdfs:label="owner"
rdfs:comment="Specifies the owner of a file">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:domain rdf:resource="#File"/>
<rdfs:domain rdf:resource="#Directory"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</rdf:Property>

<rdf:Property rdf:ID="canRead"
rdfs:label="can read"
rdfs:comment="Specifies if the file can be read (by the current user)">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:domain rdf:resource="#File"/>
<rdfs:domain rdf:resource="#Directory"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
</rdf:Property>

<rdf:Property rdf:ID="canWrite"
rdfs:label="can write"
rdfs:comment="Specifies if the file can be written to (by the current user)">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:domain rdf:resource="#File"/>
<rdfs:domain rdf:resource="#Directory"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
</rdf:Property>

<rdf:Property rdf:ID="canExecute"
rdfs:label="can execute"
rdfs:comment="Specifies if the file can be executed (by the current user)">
<rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/>
<rdfs:domain rdf:resource="#File"/>
<rdfs:domain rdf:resource="#Directory"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
</rdf:Property>
</rdf:RDF>

Note - Querying the filesystem definition model only returns the inclusion and exclusion statements, not the filesystem information.

Valid XHTML 1.0 TransitionalValid CSS 3.0!