Class RDToOnto_API
- java.lang.Object
-
- fi.tut.mei.resdescapi.rdtoontoapi.RDToOnto_API
-
public class RDToOnto_API extends Object
API for transforming Resource Description (RD) to resourceModel ontology.- Author:
- Hieu Trinh, Niko Siltala
-
-
Constructor Summary
Constructors Constructor Description RDToOnto_API()
Constructs a new RDToOnto_API (Should use a constructor with an Ontology's uri as a parameter instead)RDToOnto_API(String uri)
Constructs a new RDToOnto_API with a specific ontologyRDToOnto_API(String uri, String rdConfigFile)
Constructs a new RDToOnto_API with a specific ontology
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
clearOntologyCreator()
create new instance of OntologyCreator with old uri.OntoCreator
getOntologyCreator()
get an Ontology creator's instanceprotected ResourceDescription
getResourceDescriptionFromLocation(String xml)
read Resource Description xml fileboolean
isResourceIncluding()
void
saveOntology(String filename)
save an ontology filevoid
setOntology(String uri)
set a new ontology.void
setResourceIncluding(boolean isResourceIncluding)
boolean
transformRDFromCatalogue(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogueInfo, String rdId, boolean withItf)
Look for a resource containing expected rd Id, then transform it into an ontologyboolean
transformRDFromCatalogue(String[] rdIds, String[] catalogues)
Deprecated.boolean
transformRDFromCatalogue(String catalogueId, String rdId)
look for resource description by Id in a catalogue, then transform it into an ontology object.boolean
transformRDFromCatalogue(String catalogueId, String[] rdIds)
look for resource descriptions by list of Ids in a catalogue, then transform them into an ontology object.boolean
transformRDFromCatalogue(String catalogueId, String[] rdIds, boolean withItf)
look for resource descriptions by list of Ids in a catalogue, then transform them into an ontology object.boolean
transformRDFromCatalogue(String catalogueId, String rdId, boolean withItf)
look for resource description by Id in a catalogue, then transform it into an ontology objectboolean
transformRDFromFile(String categoryId, String fileLocation)
Reads in Resource Description file (XML format) then transform it into an Ontology object.boolean
transformRDFromFile(String categoryId, String fileLocation, boolean withItf)
Reads in Resource Description file (XML format) then transform it into an Ontology object.void
transformRDFromFolder(String categoryId, String folder)
Transform all RD XML contents in folder to ontology.void
transformRDFromFolder(String categoryId, String folder, boolean withIf)
Transform all RD XML contents in folder to ontology Note: Blueprint (and resource interface) will be transformedboolean
transformRDIntoOnto(ResourceDescription rdData)
Deprecated.boolean
transformRDIntoOnto(ResourceDescription[] rdDatas)
Deprecated.boolean
transformRDIntoOntoByRdId(String rdId)
Deprecated.boolean
transformRDIntoOntoByRdId(String[] rdIds)
Deprecated.boolean
transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogueInfo)
Transform a catalogue to ontology Note: without interface definitionsboolean
transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogueInfo, boolean withItf)
Transform a catalogue and all resources to ontologyboolean
transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogue, fi.tut.mei.matchmaking.model.xml.msg.ResourceCT resource)
Transform a resource without interface definition to ontologyboolean
transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogueInfo, fi.tut.mei.matchmaking.model.xml.msg.ResourceCT resourceInfo, boolean withItf)
Transform a resource to ontologyboolean
transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogueInfo, List<fi.tut.mei.matchmaking.model.xml.msg.ResourceCT> resourceInfos)
Transform resources without interface definition to ontologyboolean
transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogueInfo, List<fi.tut.mei.matchmaking.model.xml.msg.ResourceCT> resourceInfos, boolean withItf)
Transform resources to ontologyboolean
transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourcePoolCT resourcePool)
Transform all catalogues of a resource pool to ontology Note: without interface definitionsboolean
transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourcePoolCT resourcePool, boolean withItf)
Transform all catalogues of a resource pool to ontologyboolean
transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.SystemLayoutCT systemLayout)
Transform all resource catalogues in System Layout to ontology without interface definitionsboolean
transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.SystemLayoutCT systemLayout, boolean withItf)
Transform all resource catalogues in System Layout to ontology with interface definitionsboolean
transformRDtoOnto(ResourceDescription rdData, String catalogueId, boolean withItf)
Transform a resource description object into an ontology object.boolean
transformRDtoOnto(List<fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT> catalogueInfos)
Transform list of catalogues to ontology Note: without interface definitionsboolean
transformRDtoOnto(List<fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT> catalogueInfos, boolean withItf)
Transform list of catalogues to ontology
-
-
-
Constructor Detail
-
RDToOnto_API
public RDToOnto_API()
Constructs a new RDToOnto_API (Should use a constructor with an Ontology's uri as a parameter instead)
-
RDToOnto_API
public RDToOnto_API(String uri)
Constructs a new RDToOnto_API with a specific ontology- Parameters:
uri
- URI for the ontology that will be created with this.
-
-
Method Detail
-
setOntology
public void setOntology(String uri)
set a new ontology. Beware, all data will be cleared.- Parameters:
uri
- URI for the ontology that will be created with this.
-
clearOntologyCreator
public void clearOntologyCreator()
create new instance of OntologyCreator with old uri. All data inside Ontology creator will be cleared.
-
getOntologyCreator
public OntoCreator getOntologyCreator()
get an Ontology creator's instance- Returns:
- an ontology creator's instance
-
isResourceIncluding
public boolean isResourceIncluding()
- Returns:
- the isResourceIncluding
-
setResourceIncluding
public void setResourceIncluding(boolean isResourceIncluding)
- Parameters:
isResourceIncluding
- the isResourceIncluding to set
-
getResourceDescriptionFromLocation
protected ResourceDescription getResourceDescriptionFromLocation(String xml)
read Resource Description xml file- Parameters:
xml
- resource description xml file- Returns:
-
transformRDIntoOnto
@Deprecated public boolean transformRDIntoOnto(ResourceDescription rdData) throws Exception
Deprecated.transform a resource description into an Ontology object. Only blueprint in all resources of the resource description (Capability, basicResourceInformation) is transformed- Parameters:
rdData
- resource description object- Returns:
- true if success, false if no resource
- Throws:
Exception
-
transformRDIntoOnto
@Deprecated public boolean transformRDIntoOnto(ResourceDescription[] rdDatas) throws Exception
Deprecated.transform a resource description into list of Ontology object. Only blueprint in all resources of the resource description (Capability, basicResourceInformation) is transformed- Parameters:
rdDatas
- array of resource descriptions- Returns:
- true if success, false otherwise
- Throws:
Exception
-
transformRDIntoOntoByRdId
@Deprecated public boolean transformRDIntoOntoByRdId(String rdId) throws Exception
Deprecated.look for a resource description by Id, then transform it into an ontology file. Only blueprint in all resources of the resource description (Capability, basicResourceInformation) is transformed- Parameters:
rdId
- Id of resource description- Returns:
- true if success, false otherwise
- Throws:
Exception
-
transformRDIntoOntoByRdId
@Deprecated public boolean transformRDIntoOntoByRdId(String[] rdIds) throws Exception
Deprecated.look for resource descriptions by list of Ids, then transform them into an ontology object. Only blueprint in all resources of the resource description (Capability, basicResourceInformation) is transformed- Parameters:
rdIds
- list of resource description's id- Returns:
- true if success, false otherwise
- Throws:
Exception
-
transformRDFromCatalogue
@Deprecated public boolean transformRDFromCatalogue(String[] rdIds, String[] catalogues) throws Exception
Deprecated.look for resource descriptions by list of Ids in list of catalogues, then transform them into an ontology object. Only blueprint in all resources of the resource description (Capability, basicResourceInformation) is transformed- Parameters:
rdId
- list of Ids of resource descriptioncatalogues
- catalogue name- Returns:
- true if success, false otherwise
- Throws:
Exception
-
saveOntology
public void saveOntology(String filename) throws FileNotFoundException, IOException
save an ontology file- Parameters:
filename
- output file path- Throws:
FileNotFoundException
- if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reasonIOException
- if cannot write the ontology
-
transformRDFromCatalogue
public boolean transformRDFromCatalogue(String catalogueId, String rdId) throws Exception
look for resource description by Id in a catalogue, then transform it into an ontology object. Only blueprint in all resources of the resource description (Capability, basicResourceInformation) is transformed- Parameters:
catalogueId
- catalogue idrdId
- Id of resource description- Returns:
- true if success, false otherwise
- Throws:
Exception
-
transformRDFromCatalogue
public boolean transformRDFromCatalogue(String catalogueId, String rdId, boolean withItf) throws Exception
look for resource description by Id in a catalogue, then transform it into an ontology object- Parameters:
catalogueId
- catalogue idrdId
- Id of resource descriptionwithItf
- true if including interface definition, otherwise no- Returns:
- true if success, false otherwise
- Throws:
Exception
-
transformRDFromCatalogue
public boolean transformRDFromCatalogue(String catalogueId, String[] rdIds) throws Exception
look for resource descriptions by list of Ids in a catalogue, then transform them into an ontology object. Only blueprint in all resources of the resource description (Capability, basicResourceInformation) is transformed- Parameters:
rdId
- list of Ids of resource descriptioncatalogueId
- catalogue id- Returns:
- true if success, false otherwise
- Throws:
Exception
-
transformRDFromCatalogue
public boolean transformRDFromCatalogue(String catalogueId, String[] rdIds, boolean withItf) throws Exception
look for resource descriptions by list of Ids in a catalogue, then transform them into an ontology object.- Parameters:
rdId
- list of Ids of resource descriptioncatalogueId
- catalogue idwithItf
- true if including interface definition, otherwise no- Returns:
- true if success, false otherwise
- Throws:
Exception
-
transformRDFromCatalogue
public boolean transformRDFromCatalogue(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogueInfo, String rdId, boolean withItf) throws Exception
Look for a resource containing expected rd Id, then transform it into an ontology- Parameters:
catalogueInfo
- catalogue info received from the matchmaking servicerdId
- resource description idwithItf
- true if including interface definition, otherwise no- Returns:
- true if success, false otherwise
- Throws:
Exception
-
transformRDFromFolder
public void transformRDFromFolder(String categoryId, String folder) throws InvalidPathException, IOException
Transform all RD XML contents in folder to ontology. Note: Only blueprint in all resources of the resource description (Capability, basicResourceInformation) is transformed- Parameters:
catalogueId
- catalogue idfolder
- location of a folder- Throws:
InvalidPathException
- throw this exception if invalid pathIOException
- throw this exception if an I/O error occured
-
transformRDFromFolder
public void transformRDFromFolder(String categoryId, String folder, boolean withIf) throws InvalidPathException, IOException
Transform all RD XML contents in folder to ontology Note: Blueprint (and resource interface) will be transformed- Parameters:
catalogueId
- catalogue idfolder
- location of a folderwithItf
- including interface definitions or not- Throws:
InvalidPathException
- throw this exception if invalid pathIOException
- throw this exception if an I/O error occured
-
transformRDFromFile
public boolean transformRDFromFile(String categoryId, String fileLocation) throws Exception
Reads in Resource Description file (XML format) then transform it into an Ontology object. Only blueprint in all resources of the resource description (Capability, basicResourceInformation) is transformed- Parameters:
categoryId
- catalogue idfileLocation
- Location of the file (in local file system, network drive or web location).- Returns:
- true if success, otherwise false
- Throws:
Exception
-
transformRDFromFile
public boolean transformRDFromFile(String categoryId, String fileLocation, boolean withItf) throws Exception
Reads in Resource Description file (XML format) then transform it into an Ontology object. Blueprint (with interface definition) in all resources of the resource description (Capability, basicResourceInformation) is transformed- Parameters:
catalogueId
- catalogue idfileLocation
- Location of the file (in local file system, network drive or web location).withItf
- including interface definitions or not- Returns:
- true if success, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(ResourceDescription rdData, String catalogueId, boolean withItf) throws Exception
Transform a resource description object into an ontology object. Blueprint and resource interface will be transformed. In addition, it's connected with a catalogue ontology- Parameters:
rdData
- resource description objectcatalogueId
- catalogue idwithItf
- including interface definitions or not- Returns:
- true if success, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.SystemLayoutCT systemLayout) throws Exception
Transform all resource catalogues in System Layout to ontology without interface definitions- Parameters:
systemLayout
- system layout- Returns:
- true if succeed, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.SystemLayoutCT systemLayout, boolean withItf) throws Exception
Transform all resource catalogues in System Layout to ontology with interface definitions- Parameters:
systemLayout
- system layoutwithItf
- with/without interface definitions- Returns:
- true if succeed, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourcePoolCT resourcePool) throws Exception
Transform all catalogues of a resource pool to ontology Note: without interface definitions- Parameters:
resourcePool
- a resource pool- Returns:
- true if succeed, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourcePoolCT resourcePool, boolean withItf) throws Exception
Transform all catalogues of a resource pool to ontology- Parameters:
resourcePool
- a resoure poolwithItf
- including interface definitions or not- Returns:
- true if succeed, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(List<fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT> catalogueInfos) throws Exception
Transform list of catalogues to ontology Note: without interface definitions- Parameters:
catalogueInfos
- list of catalogues- Returns:
- true if succeed, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(List<fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT> catalogueInfos, boolean withItf) throws Exception
Transform list of catalogues to ontology- Parameters:
catalogueInfos
- list of catalogueswithItf
- including interface definitions or not- Returns:
- true if succeed, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogueInfo) throws Exception
Transform a catalogue to ontology Note: without interface definitions- Parameters:
catalogueInfo
- a resource catalogue- Returns:
- true if succeed, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogueInfo, boolean withItf) throws Exception
Transform a catalogue and all resources to ontology- Parameters:
catalogueInfo
- a resource cataloguewithItf
- including interface definitions or not- Returns:
- true if succeed, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogueInfo, List<fi.tut.mei.matchmaking.model.xml.msg.ResourceCT> resourceInfos) throws Exception
Transform resources without interface definition to ontology- Parameters:
catalogueInfo
- a resource catalogue which resources belongresourceInfos
- list of resources- Returns:
- true if succeed, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogueInfo, List<fi.tut.mei.matchmaking.model.xml.msg.ResourceCT> resourceInfos, boolean withItf) throws Exception
Transform resources to ontology- Parameters:
catalogueInfo
- a resource catalogue which resources belongresourceInfos
- list of resourceswithItf
- including interface definitions or not- Returns:
- true if all resources are transformed successful, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogue, fi.tut.mei.matchmaking.model.xml.msg.ResourceCT resource) throws Exception
Transform a resource without interface definition to ontology- Parameters:
catalogue
- a resource catalogue which resource belongsresource
- a resource- Returns:
- true if succeed, otherwise false
- Throws:
Exception
-
transformRDtoOnto
public boolean transformRDtoOnto(fi.tut.mei.matchmaking.model.xml.msg.ResourceCatalogueCT catalogueInfo, fi.tut.mei.matchmaking.model.xml.msg.ResourceCT resourceInfo, boolean withItf) throws Exception
Transform a resource to ontology- Parameters:
catalogueInfo
- a resource catalogue which resource belongsresourceInfo
- a resourcewithItf
- including interface definitions or not- Returns:
- true if the resource is transformed successful, otherwise false
- Throws:
Exception
-
-