Couldn't Load OWL file using OWLAPI - owl-api

I’m trying to load .owl file using owlapi thorough net beans to insert individual and its data properties using the code listed in owlapi documentation but it couldn't load the file, but when I converted the .owl file to .rdf format it was loaded successfully and i was able to insert the required data. I need to manipulate .owl file not .rdf format
Following is the code I have used to load the .owl without succeed
File fileBase = new File("src/java/ontology.owl);
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology= manager.loadOntologyFromOntologyDocument(fileBase);
but when i have used the rdf fromat as shown below it was loaded succefully
File fileBase = new File("src/java/ontology.rdf);
So how can I overcome this issue and load the .owl file?
Is the following command is the best command to save the axioms to ontology file?
manager.saveOntology(ontology);

I would suggest you checking your OWL file. If it can't parse the ontology it will throw an exception. You need to catch and read the exception. Most probably is a parsing problem. Your commands are totally fine.
Saving the ontology by your command is fine, but the best way according to OWL documentation is to "apply changes" after each change. Something like:
manager.applyChange(axiom);

Its an issue with the .owl file of yours. Use the link below to validate your ontology file
http://mowl-power.cs.man.ac.uk:8080/validator/

Related

Bulk Edit for annotation set in alexa ASR not working

I am interested in using the annotation set feature that is part of model evaluation in the Alexa developer console. Currently, I am able to import in the zip file containing all the mp3 files, however the "Expected Transcription" for each mp3 file is not filled in. According to https://developer.amazon.com/en-US/docs/alexa/asr/create-annotation-set.html#metadata, I can use the bulk edit feature to fill in each file's metadata at once instead of doing it one at a time. However, when I try to import the bulk edit file (I have tried both CSV and JSON) the mp3 file does not get the "Expected Transcription" line filled in. Instead a new annotation is created where the mp3 file is then missing. I have included a picture below for better reference. I have tried uploading the bulk edit first and then the mp3 files but that does not give me better results.
What the annotation set on ASR in developer console looks like:

Convert FDF file content into PDF readable format as attachment using APEX

I have an FDF format attachment which needs to be converted into PDF format attachment. I am facing issues while reading the FDF file content.
I believe FDF formatted files are not text files. While you can technically read any file in Apex, you will not be able to parse the file, since it's in a format designed to be ready by an Adobe product.
The only way to work with this from Apex would be to run the Acrobat Forms Data Format Toolkit on another server and then perform a callout from Apex to the other server. Apex itself will not be able to work with the format.
This concept of running a web service as a form of middleware is commonly used and Apex does make it very easy to perform callouts.

Zip file format for uploading pre-annotated data in Watson Knowledge Studio

I am trying to figure out how to include a pre-annotated model in Watson Knowledge Studio. I have followed the information found here but it doesn't seem to generalize. As a start I have tried exporting an annotated set from Knowledge Studio to re-upload (using the "Import corpus documents and include ground truth" option). If I re-upload the exported zip as-is this works but if I unzip the folder and then recompress it I get the following error:
A file could not be imported: The imported ZIP file is not in the expected format. Check whether the file was exported from another project. The type system from the same project must be imported first. (You selected 'Import corpus documents and include ground truth').
I have tried using the zip command in Linux (both with and without the -k flag which tries to force to MS-DOS style naming) and also used the compress utility in Windows but I get the same error each time. This is without making any changes to the contents of the folder.
Any help would be greatly appreciated!
Would you please check internal structure of your created ZIP with comparing the original ZIP ? Sometime I got the similar trouble report and found that their created ZIP contains root folder in ZIP structure. WKS expects the same folder structure in the ZIP file.

save an .owl file where opened from url in protégé

I downloaded dron ontology using protégé "open from url".In it's .owl file is just a series of urls that protégé using these urls to load them from internet.
I'm saving the project but the only thing that is saving is the original file(the file witch contain urls) and every time I should get all of data from the internet.what should I do to save complete file on my computer disk?
Save a copy of the ontology and of each imported ontology to the same folder. Next time you open it in Protege, a catalog.xml file should be created, and Protege will use the local copies.
This should work as long as the ontology IRI for the imported ontologies matches the import IRI in the main ontology - i.e., if the ontology IRI matches the URL for the ontology document. If that's not the case, Protege won't be able to know which ontology is at the remote site without downloading it; in that case you have to follow AKSW's comment and change the import axioms.

Write Microsoft Project file

I have a requirement to export to Microsoft Project from my company's program. As far as I've seen there are a few options:
Use one of the interchange formats, e.g. xml, mpx, mpd
Use the COM object model and automation to write the file
Buy a library that can write the files
The interchange formats have the problem that they will give you an import dialog when you open them, and if you want to save in a different format you need save as, and you need to select the file format before opening them. I.e. it's not a smooth experience for the customer.
Automation requires everyone who exports from our program to have MS Project installed, which is not acceptable.
The only library I could find was Aspose.Tasks which only writes into the Project XML format.
Does anyone know of any library that can write native mpp files? I've seen a post from Microsoft that they have no intention of documenting the file format, but there are some Project Viewers out there so someone must have done something with it? (Although reading from it can be done with an OleDB provider now that I think about it).
Anyone? Write MPP files?
The .NET Framework has the Microsoft.Office.Interop.MSProject set of classes. You could use them directly if your app is .NET, or write a dll in .NET and then reference that from your app.
I have never had reason to import or export Project files in non-native format but for kicks I just created and exported a simple Project in .XML format. Sure enough, when I open that file using the user interface I have to decide if I want to:
a) open as a new file,
b) Append the data to the active project or
c) Merge the data into the active project.
But, if I open the file using a VBA statement:
FileOpenEx ("Project1.xml")
I'm not troubled by the multiple-choice exam. If the default option provided by FileOpenEx is appropriate you could concoct a very simple procedure to which you could direct your users. I'm not sure if this meets your need?

Resources