Check Uri for Knowledge Base Creation#400
Conversation
39d59ca to
d4934ba
Compare
white-gecko
left a comment
There was a problem hiding this comment.
The wording of the error message should be improved. Further it would be good to implement the fix in Erfurt and catch the according exception here.
Please also check at which level OntoWiki is already catching such Exceptions.
| return; | ||
| } else if (!Erfurt_Uri::check($newModelUri)) { | ||
| $this->_owApp->appendMessage( | ||
| new OntoWiki_Message('The given String is no legal URI (http://...)', OntoWiki_Message::ERROR) |
There was a problem hiding this comment.
The hint "http://…" connotes, that the algorithm already identified the missing protocol part, while there might be other cases for the value not being a valid URI or IRI.
| return; | ||
| } else if (!Erfurt_Uri::check($newModelUri)) { | ||
| $this->_owApp->appendMessage( | ||
| new OntoWiki_Message('The given String is no legal URI (http://...)', OntoWiki_Message::ERROR) |
There was a problem hiding this comment.
"String" is a very technical term in this case, better use "value"
| return; | ||
| } else if (!Erfurt_Uri::check($newModelUri)) { | ||
| $this->_owApp->appendMessage( | ||
| new OntoWiki_Message('The given String is no legal URI (http://...)', OntoWiki_Message::ERROR) |
There was a problem hiding this comment.
Since we are aiming for IRI support, it is better to write IRI or URI (resp. other way round)
There was a problem hiding this comment.
Also check if the check supports IRIs
d4934ba to
0830280
Compare
|
done in AKSW/Erfurt#129 --- is the error message ok? |
0830280 to
28861fc
Compare
|
now uses error codes to check if the exception gets catched or not |
28861fc to
4f0081d
Compare
|
Do URNs (urn:…) and https:// URI still work? |
|
are urn:'s really valid RDF/Modelnames? *edit |
4f0081d to
b42a80f
Compare
|
What about ftp://… and tel:… I think there are more valid kinds of URIs resp. IRIs and afaik all of them are allowed for models. https://tools.ietf.org/html/rfc3986 https://en.wikipedia.org/wiki/Uniform_Resource_Identifier |
b42a80f to
5c3ae49
Compare
|
We are now using the PHP filter |
|
Could you add the test? |
faa4e24 to
aebe011
Compare
white-gecko
left a comment
There was a problem hiding this comment.
Finally please rebase and squash the commits.
| ['urn:oasis:names:specification:docbook:dtd:xml:4.1.2', true], | ||
| ['https://www.aksw.org/faq', true], | ||
| ['ptth://www.aksw.org', true], | ||
| ['\\äüö', false] |
There was a problem hiding this comment.
Please add some more failing examples
| public function testCreateActionFiltersOnlyIncorrectUris($uri, $correctUri) | ||
| { | ||
|
|
||
|
|
There was a problem hiding this comment.
Please also check the coding standard with code sniffer
b7a6132 to
99d1b39
Compare
| new OntoWiki_Message( | ||
| 'Given Knowledge Base already exists.', | ||
| OntoWiki_Message::ERROR | ||
| ) |
There was a problem hiding this comment.
Why do you touch this twice?
| * | ||
| * @copyright Copyright (c) 2006-2016, {@link http://aksw.org AKSW} | ||
| * @copyright Copyright (c) 2006-2017, {@link http://aksw.org AKSW} | ||
| * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL) |
There was a problem hiding this comment.
This can go to the first commit.
adds a test for the filter and adds frontendlogin into the ControllerTestCase.php
99d1b39 to
d28de85
Compare
|
Done @white-gecko |
This fix checks the URI for knowledge base creation for http://
This Pull Request does fix #399