org.topbraid.rdfa.graphstore
Class RDFaGraphStore
java.lang.Object
org.topbraid.core.io.AbstractGraphStore
org.topbraid.rdfa.graphstore.RDFaGraphStore
- All Implemented Interfaces:
- IGraphStore
public class RDFaGraphStore
- extends AbstractGraphStore
|
Field Summary |
static java.lang.String |
BASE_URI
|
static java.lang.String |
FILE_SUFFIX
|
static java.lang.String |
TIDY
|
static java.lang.String |
URL
|
|
Method Summary |
void |
close(org.eclipse.core.resources.IFile file)
Closes any resources allocated by a given file. |
static java.lang.String |
getBaseURI(org.eclipse.core.resources.IFile rdfaFile)
|
java.net.URI |
getBaseURI(org.eclipse.core.resources.IFile file,
java.util.Set imports)
Gets the declared base URI and the owl:imports of a given file. |
ImageMetadata |
getImageMetadata()
Gets a (base) image to display files of this type in the Navigator
(and potentially elsewhere). |
static java.lang.String |
getURLString(org.eclipse.core.resources.IFile rdfaFile)
|
boolean |
isReadOnly(org.eclipse.core.resources.IFile file)
Checks if a given IFile is read-only. |
static boolean |
isTidy(org.eclipse.core.resources.IFile rdfaFile)
|
com.hp.hpl.jena.graph.Graph |
load(org.eclipse.core.resources.IFile file,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates a new Jena Graph for a given IFile. |
static com.hp.hpl.jena.graph.Graph |
load(java.lang.String urlString,
java.lang.String baseURI,
boolean tidy)
|
static com.hp.hpl.jena.graph.Graph |
load(java.lang.String urlString,
java.lang.String baseURI,
boolean tidy,
org.eclipse.core.resources.IFile baseFile)
|
void |
save(org.eclipse.core.resources.IFile file,
com.hp.hpl.jena.graph.Graph graph,
java.lang.String baseURI)
|
boolean |
saveAs(org.eclipse.core.resources.IFile file,
com.hp.hpl.jena.graph.Graph graph,
java.lang.String baseURI)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BASE_URI
public static final java.lang.String BASE_URI
- See Also:
- Constant Field Values
FILE_SUFFIX
public static final java.lang.String FILE_SUFFIX
- See Also:
- Constant Field Values
TIDY
public static final java.lang.String TIDY
- See Also:
- Constant Field Values
URL
public static final java.lang.String URL
- See Also:
- Constant Field Values
RDFaGraphStore
public RDFaGraphStore()
close
public void close(org.eclipse.core.resources.IFile file)
throws java.lang.Exception
- Description copied from interface:
IGraphStore
- Closes any resources allocated by a given file.
- Parameters:
file - the file representing the store
- Throws:
java.lang.Exception
getBaseURI
public java.net.URI getBaseURI(org.eclipse.core.resources.IFile file,
java.util.Set imports)
throws java.lang.Exception
- Description copied from interface:
IGraphStore
- Gets the declared base URI and the owl:imports of a given file.
For example, in the standard file back-end this would use file
introspection to check the declared xml:base and the owl:imports
of the owl:Ontology.
- Parameters:
file - the file to get the base URI ofimports - an initially empty Set that will contain imported URIs
- Returns:
- the base URI
- Throws:
java.lang.Exception
getBaseURI
public static java.lang.String getBaseURI(org.eclipse.core.resources.IFile rdfaFile)
throws java.io.IOException
- Throws:
java.io.IOException
getImageMetadata
public ImageMetadata getImageMetadata()
- Description copied from interface:
IGraphStore
- Gets a (base) image to display files of this type in the Navigator
(and potentially elsewhere).
- Returns:
- the IImage or null to use the default image
getURLString
public static java.lang.String getURLString(org.eclipse.core.resources.IFile rdfaFile)
throws java.io.IOException
- Throws:
java.io.IOException
isReadOnly
public boolean isReadOnly(org.eclipse.core.resources.IFile file)
- Description copied from interface:
IGraphStore
- Checks if a given IFile is read-only. This is typically used for graph stores
that just provide a view on some external data source, such as a D2RQ database
(here: all files would be read-only), or for stores like the Sesame remote back-end
where selected files may be read-only.
- Returns:
- true if this is a read-only store
isTidy
public static boolean isTidy(org.eclipse.core.resources.IFile rdfaFile)
throws java.io.IOException
- Throws:
java.io.IOException
load
public com.hp.hpl.jena.graph.Graph load(org.eclipse.core.resources.IFile file,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws java.lang.Exception
- Description copied from interface:
IGraphStore
- Creates a new Jena Graph for a given IFile.
This method is only called after the system has determined whether this
engine is actually responsible for the file's extension.
- Parameters:
file - the file to loadmonitor - the monitor for status reports or null
- Returns:
- a new Graph
- Throws:
java.lang.Exception - if something went wrong
load
public static com.hp.hpl.jena.graph.Graph load(java.lang.String urlString,
java.lang.String baseURI,
boolean tidy)
throws java.net.MalformedURLException,
java.io.IOException
- Throws:
java.net.MalformedURLException
java.io.IOException
load
public static com.hp.hpl.jena.graph.Graph load(java.lang.String urlString,
java.lang.String baseURI,
boolean tidy,
org.eclipse.core.resources.IFile baseFile)
throws java.net.MalformedURLException,
java.io.IOException
- Throws:
java.net.MalformedURLException
java.io.IOException
save
public void save(org.eclipse.core.resources.IFile file,
com.hp.hpl.jena.graph.Graph graph,
java.lang.String baseURI)
throws java.io.IOException
- Throws:
java.io.IOException
saveAs
public boolean saveAs(org.eclipse.core.resources.IFile file,
com.hp.hpl.jena.graph.Graph graph,
java.lang.String baseURI)
throws java.lang.Exception
- Returns:
- true if the new IFile shall be the editor's input
- Throws:
java.lang.Exception