How to execute SWRL Rules in Protege 4.3? - protege

I have created an ontology in Protege 4.3 along with a set of SWRL rules. In order to execute those rules and execute queries do I need another program to work with Protege or a plugin? Is a reasoner useful for this job? Searching I came across a lot of reasoners but I can't understand their usage, although I believe they may be relevant. I have found a lot of questions in here regarding Protege but none of them actually helped.

SWRL rules require a reasoner that supports them (as mentioned already by Joshua Taylor). This reasoner must come in the form of a Protege plugin to be usable inside Protege.
Usually Protege ships with at least one reasoner supporting SWRL rules, that's HermiT. You should see it available in the Reasoner menu.
To let any reasoner be used (for either SWRL or OWL inference), just select it and click on Reasoner -> Start reasoner.

Related

Sublime, altering behavior of highlighting definions upon mouse-hover

I have a project with several classes which partly share functions while at other times the functions are different in code, but use the same name.
When hovering over a function name, Sublime highlights every file and line where that definition is found.
In my opinion it would be better if it actually included which class the different highlights belong to.
Is it possible to edit this in some way ?
Assume systems.js contains 4 different classes (1 base, 3 children). I would like to append or prepend the shown strings by the class definition (fetchable via prototype).
The hover popup mentioned in your question is powered by Sublime's internal symbol index, which is created in combination with the syntax definition that's used to syntax highlight files that you're editing. The Sublime syntax system is fairly context free; it parses the structure of the code but it doesn't contain any real structural information about it.
So for example it can determine that getShots is a function or method because of the syntax that was used to define it, but it doesn't know what class it came from.
The code for the hover popup is available in Default/symbol.py (you can use PackageResourceViewer to examine it) and associates symbols under the cursor with other places that it's seen symbols with that name in other files in the project; it literally only knows the information that you see in the popup; places where things by that name are defined and places where things of that name are referenced.
So in one sense, the answer to your question is No; core sublime can't do that because it doesn't have enough code intelligence to be able to figure that sort of thing out; this is exacerbated by dynamic languages like JavaScript where things can theoretically change at runtime as well.
The primary reason for that is because Sublime is extensible enough to support literally every programming language instead of just focusing on one or two (as e.g. PhpStorm does), so it doesn't have the core code to determine the information required.
All that said, since Sublime is indeed extremely extensible, it's possible that external code that does specialize on a language could be leveraged by a package in order to provide the appropriate information.
Two examples of that are SublimeCodeIntel and LSP for example. I don't use either of them myself, so I don't know for sure how good a fit they might be in your workflow.
I highly recommend you shift to Visual Studio Code majorly because sublime is an editor whereas vs code is an IDE. Also, it has very great extension support for all languages. I would recommend you to use jshint which the most popular plugin for js code available for almost all popular editors and IDEs. But still if you want to go with Sublime I suggest you following plugins:
https://www.sitepoint.com/essential-sublime-text-javascript-plugins/

Why translation in liferay doesn't work - asset publisher

I start to use Asset Publisher in liferay. I added an article with some text in english. Then I want to add translation but there was no my language. So I added into portal-ext.properties next lines to enable more languages.
locales.enabled=ca_ES,zh_CN,en_US,fi_FI,fr_FR,de_DE,iw_IL,hu_HU,ja_JP,pt_BR,es_ES,cs_CZ,sk_SK
My language then appear, but the problem is the translation doesn't work. Not to my language, it doesn't work to any other languages. All it did is it just changed the font of the text. That's all. Can you help me and tell me what should I do? Thanks a lot.
Seems to be solved on the Liferay forums: You'll need to provide the translation yourself. Liferay offers the functionality to enter translated articles, but it doesn't translate the articles itself.
If I may add a personal remark: "...luckily". Automatic translation is not that good.

Code-oriented editor : Must-have features?

I hope this question doesn't fall into the "subjective question" case, but here's what :
I've been coding for almost 18 years, and having migrated to Macs for the last year or so, it was inevitable to start thinking about writing a code editor from scratch - probably, just to try this thing out, or to make something that perfectly suits my needs. And I was wondering :
What are the absolute MUST-HAVEs of a good code editor*? (by order of priority, if possible)
If we're talking about a not-so-conventional feature, could you give me an example of actual implementation of that particular feature? ("xxxxx" like in Notepad++ on Windows).
Looking forward to see your answers...
*Well, there is sometimes a thin line between what could be considered as an "Editor" and an "IDE", but let's just not exclude more... IDE-oriented ones...
Syntax highlighting with error checking.
"Go to Definition"/"Go to Declaration". Other types of quick "Go To"s.
As many kinds of autocompletion as you can possibly imagine.
Vim mode or being a Vim clone (command/edit mode dichotomy).
There's a lot of other nice-to-have features like automatic refactoring but the above I believe are definitive traits of a source code editor.

Adding to ReSharper's 'Related Files' list

From version 5.0 onwards, ReSharper offers a "Go To Related Files" navigation which offers a list of files that R# thinks are related to the file currently being edited: for example, base types, derived types, .designer.cs to and from the relevant .cs, and so on.
I have looked in the R# Options and also online, but have not been able to find out:
Is there a way to add files to this list, either within R# natively or by an already-existing plug-in?
(My motivation is to be able to navigate at coding time between files containing classes that are connected by a run-time-only convention-over-configuration, er, convention)
I don't know about existing plugins, but this feature is extendable.
You need to implement IRelatedFilesProvider interface in your plugin and mark it by RelatedFilesProvider attribute. As far as I know, NHibernate plugin do it for analogous task.

How to add custom code analysis in ReSharper

I'm new to ReSharper.
For those who uses Resharper, is there a way I can add custom code analysis rules?
For example I might have a rule say All private variables should start with letter "m". How can I add this to Resharper so if I violate this, it can shows as a warning or an error?
I know the question is old, but for all folks coming from google like me:
Resharper -> Options -> Code inspections -> Custom Patterns
There you can create your own rules for highlighting patterns or offering substitutions. This is for ReSharper 8. I'm not sure from which version this option is there.
Just to expand on what #AakashM notes above: this can be specified in ReSharper Options | Languages | (either Common or C# or whatever) | Naming Style.
If you click on Advanced Settings, and then double-click on one of the "entity descriptions", there is a far larger selection of possible entities (including events, namespaces etc) , together with access rights (private, protected, etc) and so on, for which you can define prefix, suffix and casing rules.
You can write your own plugins for ReSharper. Take a look at here:
http://stylecopforresharper.codeplex.com/
This is similar to what you're asking for. It might even do what you want. Not sure since I'm not a big StyleCop user.
Also take a look at the first in my series of blog posts coming on ReSharper plugins:
http://hadihariri.com/2010/01/12/writing-plug-ins-for-resharper-part-1-of-undefined/

Resources