How to save a protege 4.3 project in .n3 file notation? - owl

I have a protege project and i have saved it in .owl file format and i want now to genrate a .n3 file from the same project. Is there a way out using Protege 4.3?

I don't think this is possible. However, if you are using Protege to create the OWL file, chances are that you don't need specific features of N3 that are not part of Turtle.
Turtle is a subset of N3:
Turtle is another subset, for only expressing RDF. It is like n3-rdf
below except that it does not have the path syntax.
So the answer is: save it as Turtle syntax and change the extension to .n3
Note: If by any chance you need to use named graphs (TRIG) you can manually edit the file and add the corresponding name like this:
//prefixes
:graphName {
// ....
}

Related

How to create own dataset for Mask RCNN?

I have two folders of images, one includes images and another includes bitmaps as annotations.How can I prepare them as dataset for use in Mask RCNN?
For Mask RCNN you need to directly annotate the images so that it could be lablled also in a specific class. Use tools such as VGG Annotator for this purpose. Then you have to customly edit the .py file for your requiremtns and run it, here you will be the directory of these images along with the annotations so that it can recognise what part of the image is representing which class. Later you need to train it these using a pretrained weight file of COCO dataset. This will generate your custom weight file. THis custom weight is used for testing.
Refer these for more insight
https://github.com/gabrielgarza/Mask_RCNN
https://github.com/d-smit/kangaroo-detection-mask-rcnn
https://github.com/thomasjvarghese799/Mask-RCNN-on-Rick-Morty

How to import specific classes and object properties from an ontology in Protege?

I want to import some classes in Protege from different ontologies to my ontology. For example, I need the classes foaf:Person, org:Site, vcard:Organization, and many more.
I don't want to create them by myself (and modifying their IRI). When I did import the whole ontology (Schema.org, vCard, FOAF, …), I had many elements that I don't need.
Is there any way to do it?
— Have you looked at this thread: protege-project.136.n4.nabble.com/…
— I tried to use it, but it didn't work.
There are subtle moments, especially on step 5.
Open your target ontology.
Open the source ontology in the same window.
Select Refactor > Copy/move/delete axioms:
Select axiom selection method.
Select signature (i. e. a set set of classes, properties etc.) to import. Do not forget to press >> !
Now you can preview axioms to be imported.
Select what you want to do:
8-9. Select your target ontology:
Voila!

Loading different files using OWL API

I am using OWL API to load different files and merge into one for reasoning. I have one file describing the ontology and several files with individuals. Every individual has foaf properties, e.g., foaf:title, when I print the axioms it shows
'AnnotationAssertion(http://xmlns.com/foaf/0.1/title...'
and reasoning does not work. If I add
<'owl:DatatypeProperty rdf:about="http://xmlns.com/foaf/0.1/title'/>
into the individual file than title loads as
'DataPropertyAssertion(http://xmlns.com/foaf/0.1/title...' and reasoning works.
In the FOAF ontology is says that it is a data property, but loading it did not work either. I am using OWLOntologyMerger to merge the ontologies.
And I cannot add that into every file. Is there a way to do it programmatically or any way?
Thanks.
Use owl:imports from each file to import the base ontology, or foaf.
The problem here is that the owl api needs the declaration to be available either in the file or in the imported ontologies. It is not possible to parse rdf/XML unambiguously otherwise.

Cakephp excel report using XLS helper gives an warning message in windows and displays entire xml structure in open office

I'm using cakephp XLS helper to generate Excel report in my project.
But the generated file is giving warning message in windows system as below.
Similarly the same file displays the entire xml mark-up in open-office on linux as below.
Part of the view file code is as below.
$xls->setHeader('Report_'.date('Y_m_d'));
$xls->addXmlHeader();
$xls->setWorkSheetName('Enrollment Report');
//1st row for columns name
$xls->openRow();
$xls->writeString('ID');
$xls->writeString('Zipcode');
My Client wants a proper excel report with-out any warnings in windows.
Please suggest me any excel helper for cakephp which will generate proper excel file on all the platform and different application.
Your problem is that you are using a helper that puts your data in xml format. Excel can read XML and HTML but with a warning. You should use the one that Ivo suggested in the comments. LINK
This helper really makes an xls valid format, that complys with open office and office. Also, this helper relies on PHPExcel class that is constantly updated here so your code will be easy to upgrade if needed.
Remember to follow instructions given in the helper page.
I've tried a lot of this xls helper for cakephp, but neither one work as expected, either outdated or create xml o html tables or didn't work at all, haven't tried this one though... still creating a helper using PHPExcel shouldn't give you much trouble, you may use this tutorial as a how to base to modify the helper.
I think you need to set the mime-type. This has happened to me in the past and it was when the mime-type of an older excel helper was set to an out-dated value.
The code from the linked (by Ivo) helper has the following:
function _output($title) {
header("Content-type: application/vnd.ms-excel");
header('Content-Disposition: attachment;filename="'.$title.'.xls"');
header('Cache-Control: max-age=0');
$objWriter = new PHPExcel_Writer_Excel5($this->xls);
$objWriter->setTempDir(TMP);
$objWriter->save('php://output');
}
I would make sure you are:
a) using the newest helper (http://bakery.cakephp.org/articles/melgior/2010/01/26/simple-excel-spreadsheet-helper)
b) that the mime-type is actually set.
c) that that specific mime-type is accurate.

How Do I Use Multiple po Files in CakePHP?

I'm just beginning the process of exploring i18n in CakePHP and I can't seem to find the right combination of files and functions that will allow me to use multiple po files. If I want to use a single po file (default.po) for every bit of translatable text, that works fine, but I see that becoming an unmaintainable hairball very, very quickly. I've read the docs and the few articles I can find, but none really dive into i18n beyond the trivial use of one .po file.
Here's where I am right now:
I've "baked" my po templates (.pot files) and copied those into app/locale/eng/LC_MESSAGES (I'm not going to be using the default text as the key so that I can easily spot missing keys). For now, I have -views-layouts-default.po and -views-pages-index.po.
In those .po files, I've entered the text I want to use for each key.
In my homepage (views/pages/index.ctp) and default layout (views/layouts/default.ctp) I've wrapped the text key I want to translate with the __() function.
When I load the homepage, though, all I see are they keys. No text has been translated. If I throw up a default.po file, though, any keys I drop in there are populated just fine. I'm clearly missing some piece of the puzzle, but I can't find it. Any help would be much appreciated.
Thanks.
I found the piece I was missing thanks to the CakePHP Google Group. I had been playing with the __d() convenience function, but didn't have a clear picture of how to tie it together to my .po files. The answer is easy once you know it:
The domain translation:
__d ( 'login', 'PLEASE_LOGIN' );
Will look for the "PLEASE_LOGIN" key in the file named login.po. I didn't know (and hadn't read anywhere) that domain == po file name (without extension). Learning that made all the difference.

Resources