RDF Instance Creator Readme
The RDF Instance Creator (RIC) was initially conceived as a program that
would facilitate the mark-up of photo metadata for images taken with a
digital camera. As it evolved out, it's target use shifted from the
creation of metadata for photos to the creation of metadata for anything.
RIC can read ontologies found on the web, or in the local file system, and
use the objects defined in the file. You can then fill in the data for
any of the objects you load into the program. Then with the data entered
by the user, you can auto-generate the RDF for that data. Some example
uses are to create the mark-up for a personal web page which would be
associated with the html file in some way, or to create agendas for
meetings that can be processed by anything that understands RDF.
Check out a screen shot of RIC in action.
Before you download RIC, you might want to check out the license.
If you find any problems or bugs, let me know and I will fix
it ASAP. Also, when you notify me of bugs or errors, please try to send the
event.log file that should be created when you run RIC. And
of course, any suggestions for improvements would be greatly appreciated.
Lastly, to those who wish to download the source and work on RIC, please
email me first before you make any changes. I prefer this for several reasons.
One I like to know what others are doing with the code, and I can avoid any overlaps
if two people happen to want to work on the same thing. Also, since I know you
are working on it, I can make available any and all resources I have to help
you out.
Download the class files
Download the source code
2.1 Importing Ontologies
Bring up the Open/Import dialog using "Tools->Load..." if it is not
already up on screen. Here you enter the URL of the file you would like
to import, or "Browse..." the local file system if it is a local file, and
enter in the namespace abbreviation you would like that URL to use. Hit
"Load" to read in the file and bring its contents into the program for
use. Any errors will cause a message box to pop up.
2.2 Using Imported Data
When you import a file its contents will end up in one of two places, the
class view or the instance view. The class view displays a list of all
classes currently imported into the program. To use a class, simply
select it and hit the "Use Object" button, or select the desired class and
drag it into the Active Data Area. Instances are quite similar. The
instance view displays all the instances found and imported into the
program. You can use these by selecting the desired entry and hitting the
"Use Instance" button to move it into your Active Data Area.
2.3 Filling in your own data
Now that you have imported some classes you would like to use, it's time
to fill out the data for a few instances. To fill out the data for a
class, select it from the Active Data Area. The top level is the root,
and has no functionality. The next level groups classes by their URL. So
all classes in the Active Data Area that came from the same file, will all
have the same parent node. It is important to note these URL nodes
contain no functionality, and that it is only kept this way for the sake
of organization.
The next level, and all subsequent levels are the actual data instances.
Classes are shown in the tree with their friendly class name (without the
URL) followed by their ID. Clicking on a class node will bring up in the
workspace a textfield to edit the ID of the class. Clicking on any of its
children, which are its constiuent properties, will bring up the data
entry form in the workspace. This is the form you use to fill out data
for the class. Whatever data you enter in these forms will be the data
used when the RDF is auto-generated.
2.4 RDF Generation
Once you have filled out all your data using RIC, go to "Tools->Generate
RDF..." to generate the RDF for your data. A dialog will come up where
you have one of two options, enter in the path and filename of where you
would like the RDF to be saved, or for command line users, you can spit
the RDF output directly to the console.
2.5 Editing Ontologies
You can now use RIC to edit existing ontologies to add whatever terms
you see fit. For example, if you find that a "Person" class has
everything you are looking for except a property for their Social
Security Number, you can right click on that class and select
"Add Property" from the popup menu. A dialog will appear for you to
enter in some basic data for the construction of the new property.
A similar method can be used to add classes to ontologies. Maybe
you have an ontology that talks about different types of sports, but
they omitted a sport you specifically wanted to talk about. You can
create this new sport class, and add properties to it using the above
method. To add a class to an ontology you right click on the file location
in the Active Data Area that you would like your new term to be a part
of. This will bring up a dialog where you can enter in data about
your new class, including its super classes. To add a super class, you
can either type in the fully qualified name, or you can select a class
in the class view and hit use. This will auto-populate the input field.
From this point you simply hit "Add" to add the superclass to your new class.
The edited ontologies are kept locally by RIC for later use. The next
time you enter in the URL of an ontology that you have edited, a message
box will appear allowing you to either load the previously edited copy,
download the original from the Web.
3.1 Drag and Drop
There is some drag and drop support built into RIC. You can drag classes
from the class view into the Active Data Area to use them. You can also
drag class nodes from the Active Data Area onto property nodes that take
objects as their data. There is some error checking built into this, but
not as much as should be there, ranges for the drop target are not checked
to see if the drop item is compatible with the drop target.
3.2 Searching
There is a feature to search a number of known ontologies for specific
terms. To bring up the search dialog go to "Tools->Search..." You simply
enter in the term you would like to search for and hit "Search." A
progress bar will come up to show you the progess of the search. The
first time for searches is always very slow since it needs to read in,
parse, and search every file in the search list. However, the slow first
run is offset by any subsequent searches. Files are cached, so once you
have successfully opened and parsed a file, a copy of the file is kept by
the program, so everytime that file is requested after the initial
request, it is immediately available. Searches that occur after the
initial search take place tens of times faster than the original search.
Unfortunately, the search utility only searches, anything you attempt to
use in the program from a search will not work as expected.
3.3 DAML List Support
To use a DAML List, simply right click in the Active Data Area and select
"Create->DAML List" from the popup. A DAML List object will appear in the
Active Data Area. To populate the list, simply drag classes into the list.
The order you drag them into the list will be the order they are listed in,
so if order is important, make sure you add them to the list in the intended
order. And like any other class object, you can drag list onto a property
to set the property's data to that list.
3.4 Delete
You can delete single nodes from the tree. Click on the node to delete in
the Active Data Area and hit the right mouse button. Select "Delete" from
the popup menu and the selected node will be deleted. You can only delete
class nodes.
3.5 Clear and Clear All
The "Clear" function available from the popup menu obtained by right
clicking in the Active Data Area will clear all data from the Active Data
Area. Other the other hand, the "Clear All" function available via
"Tools->Clear All" will clear not only the Active Data Area, but also the
class and instance view.
3.6 RICScript
Designed as a feature for automated test cases, RICScript is a very simple
scripting language that corresponds to most of the features available
through RIC's GUI. You can import from urls, use classes, set the data
for the classes, and generate the RDF without ever using the interface,
you simply run a script. To run a RICScript, click "File->Open" to bring
up a dialog for browsing the file system. Select the file where the
script is located and hit "Open." RIC will open the file, read the script
and perform all the specified actions. RICScripts are bound by
semi-precise exceptions. Errors in the script will not leave it half
executed. If there are any problems with the script during parsing, the
entire process fails. However, if the script passes the parsing stage
successfully, it attempts to execute the script. Any errors in the data
(such as a mistyped URL) will not stop execution and thus results will not
be accurate. The script commands are listed below and an example script
can be found where you downloaded this file.
3.6.1 RICScript Commands
IPT Imports the specified url with the specified abbreviation.
USE Creates an object of specified type with the specified id.
LD Loads an object by id as the current object
SET Sets the specified property with the value on either the currently
loaded object or the object specified in the command. ie SET Joe
pers:height 6;
ULD Unloads the current object.
GEN Generates the RDF to the specified file.
3.7 Cardinality
RIC does not strictly enfore cardinality for several reasons. The most
compelling of which is that the output generated can not be assumed to be
the end output. The RDF created could easily be merged with something
else, or finished at a later date. For this reason, RDF generation is
allowed to continue despite not meeting cardinality requirements. The way
cardinality is shown is via the workspace. Next a property's name will be
a graphic representation of its cardinality. For example, if a property
called phone_number has a minimum cardinality of 1 (everyone has a phone
number) and has an unlimited maximum (can have work, cell, home phone,
etc.) it would be displayed like: "phone_number {1,INF}" where the digit
to the left of the comma is the minimum cardinality and the number to the
right is the maximum. "INF" represents unlimited or infinite cardinality,
you can have any number of instances of a property that you want. To add
another instance of a property that has not yet met its maximum
cardinality you simply select the desired property from the Active Data
Area, right click and select "Add Another" from the menu.
3.8 Python Support
You can now write python scripts and run them in RIC to modify or extend
RIC's functionality. There are three ways to do this. One, you can select
the interactive python prompt from the "Tools" menu and enter in commands
on the fly. You can also write a script at another time and import it into
RIC via the "Load Python Script" command under the "File" menu. This will
bring up a file selection dialog and you can select a script from your local
file system that RIC will execute. Lastly, you can have a set of scripts
auto-executed on start-up. These must be placed in the "jython" directory
in the main RIC directory. In this directory there is a file called
"script_index.txt" and all files listed in that file will be auto-executed
when RIC starts. All scripts MUST be present in that directory to run.
Also, any scripts you write must have a ricInit function that takes one argument,
a reference to the RIC object. This is the function called by RIC and if
it is not present your scripts will not run properly. Note this only applies
auto-loaded scripts and scripts that are run from the "File" menu.
3.9 Node Linking
You can link two property nodes in the Active Data Area. This essentially
says that both properties point to the same node. In a graph representation
it would be two arcs pointing at the same node. To do this you simply select
two nodes from the Active Data Area, one class node and one property node.
Then right click and choose link from the popup menu. This will say that
the property now has this class as its value.
3.10 Open RDF
The "Open RDF" feature, accessible from the "File" menu is a quick and easy way
to read in RDF data and insert it into the Active Data Area. Perhaps you are working
on creating some instance data, but do not have time to finish it all. Now you can
generate the RDF to a file to save, and then read it back in later to resume where you
left off. Or if you wanted to make changes to data sent to you from someone else, this
will be a very useful feature. Once this data is read into the ADA, it behaves just like
any other sort of RDF data.
Pretty simple, just unzip the file into a folder which is now your main RIC directory. To run RIC
you simply invoke it from the command line something like this (depending on what type of system you
are on):
java -classpath "*RIC_DIR*\classes; *RIC_DIR*\jar\jython.jar" org.mindswap.ric.RIC
Please note that the *RIC_DIR* stands for the full path to your main RIC directory.
Included in the distribution package is a batch file written for windows. It should allow you to easily start RIC with a simple click. Versions for other platforms will hopefully be released soon.
Example python script
Sample output
Example RICScript
Example URLs to try:
- http://www.wam.umd.edu/~mhgrove/personOnt.rdf
- http://www.wam.umd.edu/~mhgrove/pictureOnt.rdf
- http://www.wam.umd.edu/~mhgrove/weather-ont.daml
- http://www.isi.edu/webscripter/project.o.daml
- http://www.isi.edu/webscripter/person.o.daml
- http://iama.rrecktek.com/daml/ont/Person-ont-g3r1.daml
- http://iama.rrecktek.com/daml/ont/agenda-ont
- http://www.cs.umd.edu/projects/plus/DAML/onts/univ1.0.daml
- http://www.cs.umd.edu/projects/plus/DAML/onts/base1.0.daml
- http://www.cs.umd.edu/projects/plus/DAML/onts/general1.0.daml
- http://www.cs.umd.edu/projects/plus/DAML/onts/personal1.0.daml
- Version 3.0a (this Version)
- Removed expandable text boxes due to user feedback
- Completely re-wrote parser from ground up
- Added "Open RDF" command to menu allowing RDF data to be imported directly into the ADA
- Changed the "Use Object" button. Added a sort of salience filter to display appropriate classes for use.
- Made fixes to make RIC compatible with the new parser, made several bug fixes along the way
- Fixed open dialog boxes so directories are always visible
- Version 2.87a
- Made text boxes in workspace somewhat resizeable so its easier to enter in larger amounts of text
- Can specify the destination URL of RDF files you generate (using xml:base)
- Added support for importing NTriples files. However, this is only currently accessible from the python support. A module is in the works and slated for the next release.
- UI improvements
- Version 2.85a
- Added Python support via Jython
- Added support for daml:oneOf tag
- Fixed bugs in handling of rdf:type and rdf:Description tags
- Stripped down the search and fixed numerous bugs associated with it. There is now a slow, light-weight version available for use
- Added the ability to link terms in the Active Data Area
- Added "Add Property to Class" functionality
- Added "Add Class to Ontology" functionality
- Fixed a bug that caused the parser to recurse infinitely
- Fixed a bug where namespaces were duplicated
- Added some OWL Lite support. Now handle all OWL Lite constructs except inverseOf, sameIndividualAs, and someValuesFrom
- Version 2.73a
- Streamlined parser and object model, gaining slight speedup
- Fixed bug that occured when reading instances
- Fixed list scrolling problem
- Junk chars are no longer saved when RDF is generated
- Added cardinality support to restrictions
- Added error checking on datatypes and object usage
- Disabled search due to serious bugs in code
- Several minor GUI changes and bug fixes
- Version 2.58a (Open Source Release)
- Added offline Import
- Added Clear Active Data Area
- Added Delete from Active Data Area
- Made RICCodeReader (for using RICScript) exceptions more precise. Now scripts don't half load on errors. It's now all or nothing
- Several minor UI and bug fixes
- Version 2.51a
- Added Clear All function
- Expanded Restriction support
- Minimal support for Lists
- UI changes including some drag and drop functionality
- Version 2.47a
- Stopped using Jena
- Expanded how much of the RDF/DAML language I can reliably handle
- Minimal XML support for the DOCTYPE and ENTITY tags
- Added Searching
- Version 1.90a
Report a bug
- Some bugs related to the search feature
- Linking nodes sometimes causes infinte recursion in RDF generation