public interface LIMEModel
extends it.uniroma2.art.owlart.model.ARTNodeFactory
Modifier and Type | Method and Description |
---|---|
void |
addDataset(it.uniroma2.art.owlart.model.ARTResource dataset)
Adds a dataset to this model.
|
void |
addDatasetType(it.uniroma2.art.owlart.model.ARTURIResource datasetType)
Sets the type of the working dataset.It is equivalent to the following SPARQL update executed (with
inference) on the underlying OWL model:
insert {
? |
void |
addLanguage(String language)
Registers that the dataset supports the given natural language.
|
void |
addLinguisticModel(it.uniroma2.art.owlart.model.ARTURIResource linguisticModel)
Adds a linguistic model.
|
void |
close()
Closes the undelying OWL model.
|
void |
deleteDataset(it.uniroma2.art.owlart.model.ARTResource resource)
Deletes the dataset
resource from this description. |
it.uniroma2.art.owlart.models.OWLModel |
getOWLModel()
Returns the underlying OWL Model.
|
it.uniroma2.art.owlart.model.ARTResource |
getPrimaryDataset()
Returns the primary dataset of this model.
|
it.uniroma2.art.owlart.model.ARTResource |
getWorkingDataset()
Returns the dataset which this model operations implicitly work on.
|
boolean |
hasDataset(it.uniroma2.art.owlart.model.ARTResource resource)
Checks whether a given resource is a dataset described by this model.
|
boolean |
hasGlosses()
Checks whether the working dataset has glosses.
|
boolean |
hasHumanReadableLocalNames()
Checks whether the working dataset has human readable local names.
|
boolean |
hasLanguage(String language)
Checks whether the working datasets supports the given language.
|
boolean |
hasLinguisticModel(it.uniroma2.art.owlart.model.ARTURIResource linguisticModel)
Checks if the dataset adopts the given linguistic model.
|
boolean |
hasPrimaryDataset(it.uniroma2.art.owlart.model.ARTResource resource)
Checks wheter
resource is the primary dataset of this description. |
boolean |
hasTaxonomy()
Checks whether the working dataset has a taxonomy.
|
boolean |
hasUsageExamples()
Checks whether the working dataset has usage examples.
|
it.uniroma2.art.owlart.navigation.ARTResourceIterator |
listDatasets()
Lists the datasets described in this model.
|
it.uniroma2.art.owlart.navigation.ARTURIResourceIterator |
listDatasetTypes()
Lists the types of the working dataset.
|
Iterator<String> |
listLanguages()
Lists the natural languages (identified as RDF language tags) in which the working dataset is
described.
|
it.uniroma2.art.owlart.navigation.ARTURIResourceIterator |
listLinguisticModels()
Lists the models adopted for the linguistic characterization of the working dataset.
|
void |
removeDatasetType(it.uniroma2.art.owlart.model.ARTURIResource datasetType)
Removes the assertion that the working dataset is of the given type.
|
void |
removeLanguage(String language)
Removes the indication that the working dataset supports a given natural language.
|
void |
removeLinguisticModel(it.uniroma2.art.owlart.model.ARTURIResource linguisticModel)
Removes the given lingusitic model from the working dataset.
|
void |
removePrimaryDataset(it.uniroma2.art.owlart.model.ARTResource dataset)
Removes the primary dataset of this model.
|
void |
setHasGlosses(boolean glosses)
Registers that the working dataset has a glosses.
|
void |
setHasHumanReadableLocalNames(boolean humanReadable)
Registers that the working dataset has usage examples.
|
void |
setHasTaxonomy(boolean taxonomy)
Registers that the working dataset has a taxonomy.
|
void |
setHasUsageExamples(boolean usageExamples)
Registers that the working dataset has usage examples.
|
void |
setLanguageCoverage(String lang,
it.uniroma2.art.owlart.model.ARTURIResource resourceType,
CoverageObservation coverageObservation)
Registers the extent to a given natural language covers a resource type in the working dataset.
|
void |
setLexicalResourceCoverage(it.uniroma2.art.owlart.model.ARTURIResource lexicalResource,
it.uniroma2.art.owlart.model.ARTURIResource resourceType,
CoverageObservation coverageObservation)
Registers the extent to a given lexical resource covers a resource type in the working dataset by means
of explicit links.
|
void |
setPrimaryDataset(it.uniroma2.art.owlart.model.ARTResource dataset)
Sets the primary dataset of this model.
|
void |
setWorkingDataset(it.uniroma2.art.owlart.model.ARTResource dataset)
Sets the dataset which is implicitly passed to every operation dealing with datasets.
|
Iterator<ImmutablePair<it.uniroma2.art.owlart.model.ARTURIResource,CoverageObservation>> |
sliceCoverageByLanguage(String lang)
Slices the resource coverage by language.
|
Iterator<ImmutablePair<it.uniroma2.art.owlart.model.ARTURIResource,CoverageObservation>> |
sliceCoverageByLexicalResource(it.uniroma2.art.owlart.model.ARTURIResource lexicalResource)
Slices the resource coverage by lexical resource.
|
Iterator<ImmutablePair<String,CoverageObservation>> |
sliceLanguageCoverageByResourceType(it.uniroma2.art.owlart.model.ARTURIResource resourceType)
Slices the resource coverage by resource type.
|
Iterator<ImmutablePair<it.uniroma2.art.owlart.model.ARTURIResource,CoverageObservation>> |
sliceLexicalResourceCoverageByResourceType(it.uniroma2.art.owlart.model.ARTURIResource resourceType)
Slice the coverage of links to a lexical resource by resource type.
|
void |
write(File outputFile,
it.uniroma2.art.owlart.io.RDFFormat rdfFormat)
Writes the LIME description to a file
|
void |
write(OutputStream outputStream,
it.uniroma2.art.owlart.io.RDFFormat rdfFormat)
Writes the LIME description to an output stream
|
void addDataset(it.uniroma2.art.owlart.model.ARTResource dataset) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException
prefix foaf:
prefix void:
insert {
<> foaf:topic ?dataset .
?dataset a void:Dataset .
}
where {
bind([...] as ?dataset)
}
dataset
- it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.navigation.ARTResourceIterator listDatasets() throws it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix foaf:
prefix void:
select distinct ?dataset {
<> foaf:topic ?dataset .
?dataset a void:Dataset.
}
it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelAccessException
boolean hasDataset(it.uniroma2.art.owlart.model.ARTResource resource) throws it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix foaf:
ask {
bind([...] as ?dataset)
<> foaf:topic ?dataset .
}
resource
- it.uniroma2.art.owlart.exceptions.ModelAccessException
void deleteDataset(it.uniroma2.art.owlart.model.ARTResource resource) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException
resource
from this description. It is equivalent to the following
SPARQL update executed (with inference) on the underlying OWL model:
prefix foaf:
delete {
?subject ?predicate ?object .
}
where {
bind([...] as ?resource)
?subject ?predicate ?object .
filter(?subject = ?resource || ?object = ?resource)
}
resource
- it.uniroma2.art.owlart.exceptions.ModelUpdateException
void setPrimaryDataset(it.uniroma2.art.owlart.model.ARTResource dataset) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException
prefix foaf:
delete {
<> foaf:primaryTopic ?oldDataset .
}
insert {
<> foaf:primaryTopic ?dataset .
}
where {
optional {
<> foaf:primaryTopic ?oldDataset .
}
}
dataset
- the dataset to describe as primaryit.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.model.ARTResource getPrimaryDataset() throws it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix foaf:
select distinct ?dataset {
<> foaf:primaryTopic ?dataset .
} limit 1
null
if it is not specifiedit.uniroma2.art.owlart.exceptions.ModelAccessException
boolean hasPrimaryDataset(it.uniroma2.art.owlart.model.ARTResource resource) throws it.uniroma2.art.owlart.exceptions.ModelAccessException
resource
is the primary dataset of this description. It is equivalent to the
following SPARQL query executed (with inference) on the underlying OWL model:
prefix foaf:
ask {
bind([...] as ?dataset)
<> foaf:primaryTopic ?dataset .
} limit 1
resource
- it.uniroma2.art.owlart.exceptions.ModelAccessException
void removePrimaryDataset(it.uniroma2.art.owlart.model.ARTResource dataset) throws it.uniroma2.art.owlart.exceptions.ModelAccessException, it.uniroma2.art.owlart.exceptions.ModelUpdateException
prefix foaf:
delete {
<> foaf:primaryTopic ?dataset .
}
where {
bind([...] as ?dataset)
}
it.uniroma2.art.owlart.exceptions.ModelAccessException
it.uniroma2.art.owlart.exceptions.ModelUpdateException
void setWorkingDataset(it.uniroma2.art.owlart.model.ARTResource dataset)
dataset
is null
, then the model works on the primary dataset.dataset
- the dataset to work onit.uniroma2.art.owlart.model.ARTResource getWorkingDataset() throws it.uniroma2.art.owlart.exceptions.ModelAccessException
it.uniroma2.art.owlart.exceptions.ModelAccessException
void addDatasetType(it.uniroma2.art.owlart.model.ARTURIResource datasetType) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException, it.uniroma2.art.owlart.exceptions.ModelAccessException
insert {
?workingDataset a ?datasetType.
}
where {
bind([...] as ?workingDataset)
bind([...] as ?datasetType)
}
Note. if datasetType
does not appear to subclass void:Dataset
an
unchecked IllegalArgumentException
is thrown.
datasetType
- it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelAccessException
it.uniroma2.art.owlart.navigation.ARTURIResourceIterator listDatasetTypes() throws it.uniroma2.art.owlart.exceptions.ModelAccessException
select ?datasetType {
bind([...] as ?workingDataset)
?workingDataset a ?datasetType.
?workingDataset rdfs:subClassOf void:Dataset .
filter(?datasetType != void:Dataset)
}
it.uniroma2.art.owlart.exceptions.ModelAccessException
void removeDatasetType(it.uniroma2.art.owlart.model.ARTURIResource datasetType) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException, it.uniroma2.art.owlart.exceptions.ModelAccessException
delete {
?workingDataset a ?datasetType.
}
where {
bind([...] as ?workingDataset)
bind([...] as ?datasetType)
}
it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelAccessException
void addLinguisticModel(it.uniroma2.art.owlart.model.ARTURIResource linguisticModel) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException, it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
insert {
?workingDataset lime:linguisticModel ?linguisticModel .
}
where {
bind([...] as ?workingDataset)
bind([...] as ?linguisticModel)
}
linguisticModel
- the URI of a linguistic model (e.g. RDFS, SKOS, SKOS-XL, ...)it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelAccessException
it.uniroma2.art.owlart.navigation.ARTURIResourceIterator listLinguisticModels() throws it.uniroma2.art.owlart.exceptions.ModelAccessException
void:Dataset
it.uniroma2.art.owlart.exceptions.ModelAccessException
boolean hasLinguisticModel(it.uniroma2.art.owlart.model.ARTURIResource linguisticModel) throws it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
ask {
bind([...] as ?workingDataset)
bind([...] as ?linguisticModel)
?workingDataset lime:linguisticModel ?linguisticModel .
}
linguisticModel
- it.uniroma2.art.owlart.exceptions.ModelAccessException
void removeLinguisticModel(it.uniroma2.art.owlart.model.ARTURIResource linguisticModel) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException, it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
delete {
?workingDataset lime:linguisticModel ?linguisticModel .
} where {
bind([...] as ?workingDataset)
bind([...] as ?linguisticModel)
}
linguisticModel
- it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelAccessException
void addLanguage(String language) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException, it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
insert {
?workingDataset lime:language ?language .
}
where {
bind([...] as ?workingDataset).
bind([...] as ?language);
}
language
- the natural language to addit.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelAccessException
Iterator<String> listLanguages() throws it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
select distinct ?language {
bind([...] as ?workingDataset)
?workingDataset lime:language ?languageTerm .
filter(isLiteral(?languageTerm))
bind(str(?languageTerm) as ?language)
}
it.uniroma2.art.owlart.exceptions.ModelAccessException
boolean hasLanguage(String language) throws it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
select ask {
bind([...] as ?workingDataset)
bind([...] as ?languageTerm)
?workingDataset lime:language ?languageTerm .
}
language
- it.uniroma2.art.owlart.exceptions.ModelAccessException
void removeLanguage(String language) throws it.uniroma2.art.owlart.exceptions.ModelAccessException, it.uniroma2.art.owlart.exceptions.ModelUpdateException
prefix lime:
remove {
?workingDataset lime:language ?languageTerm .
}
where {
bind([...] as ?languageTerm)
}
language
- a natural languageit.uniroma2.art.owlart.exceptions.ModelAccessException
it.uniroma2.art.owlart.exceptions.ModelUpdateException
void setLanguageCoverage(String lang, it.uniroma2.art.owlart.model.ARTURIResource resourceType, CoverageObservation coverageObservation) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException, it.uniroma2.art.owlart.exceptions.ModelAccessException
(prefix
_:workingDataset lime:languageCoverage [
lime:lang ?lang ;
lime:resourceCoverage [
lime:class ?resourceType
lime:avgNumOfEntries ?avgNumOfEntries # in coverageObservation
lime:percentage ?percentage # in coverageObservation
]
]
lang
- resourceType
- coverageObservation
- it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelAccessException
Iterator<ImmutablePair<it.uniroma2.art.owlart.model.ARTURIResource,CoverageObservation>> sliceCoverageByLanguage(String lang) throws it.uniroma2.art.owlart.exceptions.ModelAccessException
lang
- it.uniroma2.art.owlart.exceptions.ModelAccessException
Iterator<ImmutablePair<String,CoverageObservation>> sliceLanguageCoverageByResourceType(it.uniroma2.art.owlart.model.ARTURIResource resourceType) throws it.uniroma2.art.owlart.exceptions.ModelAccessException
lang
- it.uniroma2.art.owlart.exceptions.ModelAccessException
void setLexicalResourceCoverage(it.uniroma2.art.owlart.model.ARTURIResource lexicalResource, it.uniroma2.art.owlart.model.ARTURIResource resourceType, CoverageObservation coverageObservation) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException, it.uniroma2.art.owlart.exceptions.ModelAccessException
(prefix
_:workingDataset lime:lexicalResourceCoverage [
lime:lexresource ?lexicalResource ;
lime:resourceCoverage [
lime:class ?resourceType
lime:avgNumOfEntries ?avgNumOfEntries # in coverageObservation
lime:percentage ?percentage # in coverageObservation
]
]
lexicalResource
- resourceType
- coverageObservation
- it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelAccessException
Iterator<ImmutablePair<it.uniroma2.art.owlart.model.ARTURIResource,CoverageObservation>> sliceCoverageByLexicalResource(it.uniroma2.art.owlart.model.ARTURIResource lexicalResource) throws it.uniroma2.art.owlart.exceptions.ModelAccessException
lexicalResource
- it.uniroma2.art.owlart.exceptions.ModelAccessException
Iterator<ImmutablePair<it.uniroma2.art.owlart.model.ARTURIResource,CoverageObservation>> sliceLexicalResourceCoverageByResourceType(it.uniroma2.art.owlart.model.ARTURIResource resourceType) throws it.uniroma2.art.owlart.exceptions.ModelAccessException
resourceType
- it.uniroma2.art.owlart.exceptions.ModelAccessException
void setHasTaxonomy(boolean taxonomy) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException, it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
delete {
?workingDataset lime:hasTaxonomy ?oldTaxonomy .
}
insert {
?workingDataset lime:hasTaxonomy ?taxonomy .
}
where {
bind([...] as ?workingDataset)
bind([...] as ?taxonomy)
optional {
?workingDataset lime:hasTaxonomy ?oldTaxonomy .
}
}
taxonomy
- it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelAccessException
boolean hasTaxonomy() throws it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
ask {
bind([...] as ?workingDataset)
?workingDataset lime:hasTaxonomy true .
}
Note: this operation works by negation-as-failure
it.uniroma2.art.owlart.exceptions.ModelAccessException
void setHasGlosses(boolean glosses) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException, it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
delete {
?workingDataset lime:hasGlosses ?oldGlosses .
}
insert {
?workingDataset lime:hasGlosses ?glosses .
}
where {
bind([...] as ?workingDataset)
bind([...] as ?glosses)
optional {
?workingDataset lime:hasGlosses ?oldGlosses .
}
}
Note: this operation works by negation-as-failure
glosses
- it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelAccessException
boolean hasGlosses() throws it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
ask {
bind([...] as ?workingDataset)
?workingDataset lime:hasGlosses true .
}
Note: this operation works by negation-as-failure
it.uniroma2.art.owlart.exceptions.ModelAccessException
void setHasUsageExamples(boolean usageExamples) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException, it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
delete {
?workingDataset lime:hasUsageExample ?oldUsageExamples .
}
insert {
?workingDataset lime:hasUsageExample ?usageExamples .
}
where {
bind([...] as ?workingDataset)
bind([...] as ?usageExamples)
optional {
?workingDataset lime:hasUsageExample ?oldUsageExamples .
}
}
glosses
- it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelAccessException
boolean hasUsageExamples() throws it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
ask {
bind([...] as ?workingDataset)
?workingDataset lime:hasUsageExamples true .
}
Note: this operation works by negation-as-failure
it.uniroma2.art.owlart.exceptions.ModelAccessException
void setHasHumanReadableLocalNames(boolean humanReadable) throws it.uniroma2.art.owlart.exceptions.ModelUpdateException, it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
delete {
?workingDataset lime:hasHumanReadableLocalNames ?oldHumanReadable .
}
insert {
?workingDataset lime:hasHumanReadableLocalNames ?humanReadable .
}
where {
bind([...] as ?workingDataset)
bind([...] as ?humanReadable)
optional {
?workingDataset lime:hasHumanReadableLocalNames ?oldHumanReadable .
}
}
humanReadable
- it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelAccessException
boolean hasHumanReadableLocalNames() throws it.uniroma2.art.owlart.exceptions.ModelAccessException
prefix lime:
ask {
bind([...] as ?workingDataset)
?workingDataset lime:hasHumanReadableLocalNames true .
}
Note: this operation works by negation-as-failure
it.uniroma2.art.owlart.exceptions.ModelAccessException
void write(File outputFile, it.uniroma2.art.owlart.io.RDFFormat rdfFormat) throws IOException, it.uniroma2.art.owlart.exceptions.ModelAccessException, it.uniroma2.art.owlart.exceptions.UnsupportedRDFFormatException
outputFile
- rdfFormat
- IOException
it.uniroma2.art.owlart.exceptions.ModelAccessException
it.uniroma2.art.owlart.exceptions.UnsupportedRDFFormatException
void write(OutputStream outputStream, it.uniroma2.art.owlart.io.RDFFormat rdfFormat) throws IOException, it.uniroma2.art.owlart.exceptions.ModelAccessException, it.uniroma2.art.owlart.exceptions.UnsupportedRDFFormatException
outputStream
- rdfFormat
- IOException
it.uniroma2.art.owlart.exceptions.ModelAccessException
it.uniroma2.art.owlart.exceptions.UnsupportedRDFFormatException
it.uniroma2.art.owlart.models.OWLModel getOWLModel()
void close() throws it.uniroma2.art.owlart.exceptions.ModelUpdateException
it.uniroma2.art.owlart.exceptions.ModelUpdateException
Copyright © 2013 ART Group, University of Rome, Tor Vergata. All rights reserved.