Merging final developments into dice-group master#97
Conversation
Merging Changes from dice-group/Squirrel to abhihc/Squirrel
Merging changes from Dice-group/Squirrel to abhihc/Squirrel
Merging changes from updated master to develop
Merging changes from develop branch to implementation test scenarios
Getting changes from develop branch into robustness branch
Implementation test scenarios
Merging changes from Robustness branch to Develop branch
Merging develop branch in to master branch
# Conflicts: # spring-config/context-sparql.xml
Merging recent changes from robustness branch to master
MichaelRoeder
left a comment
There was a problem hiding this comment.
I left several comments pointing out necessary improvements.
| <constructor-arg index="2" value="" /> | ||
| </bean> | ||
|
|
||
| </beans> |
There was a problem hiding this comment.
It looks like you haven't changed the content of the file but the formatting. Changes like that shouldn't be commited at all. Please clarify whether you have changed the files content.
There was a problem hiding this comment.
Aakash had made changes to use FileBasedSink for his regular crawling task but I have reverted back the file content similar to that of the dice-group Squirrel.
There was a problem hiding this comment.
The problem is that its formatting is different compared to the "original file". If you want to revert changes, it might be better to check out the "original file" and overwrite your current file with this original file. However, you should check whether this old file really contains all the definitions you need.
There was a problem hiding this comment.
OK so the issue has been resolved.
There was a problem hiding this comment.
Thanks! That makes it much easier to concentrate on the changes you made 😉
| public void fetch() throws Exception { | ||
| int expected_file_content = 110; | ||
| HTTPFetcher fetcher = new HTTPFetcher(); | ||
| File data = fetcher.fetch(seeds[0]); |
There was a problem hiding this comment.
Why is the test generating crawleable URI objects for 4 classes but is checking only one single class?
There was a problem hiding this comment.
@MichaelRoeder could you please elaborate on this comment.
There was a problem hiding this comment.
The strange name of the entities and property were misleading. I thought you are using four dump files but in the end you have 3 URIs returning the same content. However, this is still confusing. Why do you need all three resources if you are fetching only one of them?
There was a problem hiding this comment.
@MichaelRoeder I have removed the unnecessary fetching from two duplicate resources as it returns the same content and testing only one seed and one resource. Have committed the code to Testcase branch in abhihc/Squirrel (abhihc@3640b16). Please let me know if I can push the code to abhihc/squirrel master so that reflects the code changes on this pull request.
There was a problem hiding this comment.
That already looks better. However, you added a second fetching step
//checks the crawlable uri object of second class
File resourceData1 = fetcher.fetch(new CrawleableUri(new URI(resources[0].getResourceName())));
assertNotNull(resourceData1);
assertEquals(expected_file_content,resourceData1.length());Can you please explain its meaning? What does the test checks here?
There was a problem hiding this comment.
Ok. Could you please explain the difference to the first fetching step? Maybe you want to (temporarily) add the following two lines to see what you are fetching:
System.out.println(seeds[0].getUri());
System.out.println(resources[0].getResourceName());There was a problem hiding this comment.
@MichaelRoeder Yes ok. Will add the above two lines to display what I am fetching.
There was a problem hiding this comment.
@MichaelRoeder I get "http://127.0.0.1:8089/entity_1.n3" for both the lines. I am fetching from this URI in both the cases.
There was a problem hiding this comment.
Exactly. So from my point if view, the second part does not really make sense since you are just repeating what you already did before. 😉
There was a problem hiding this comment.
@MichaelRoeder Removed the second part of fetching as it is of not much use.
| import java.io.File; | ||
| import java.io.IOException; | ||
|
|
||
| public class FetcherDummy4Tests implements Fetcher { |
There was a problem hiding this comment.
Please add javadoc comments to document the aim of this class, its workflow and especially the maining of the pre and post flag attributes.
I would even recommend to rename the pre and post flags since their names are not self explaining.
There was a problem hiding this comment.
@MichaelRoeder Successfully added the Javadoc comments and renamed the pre and post flag. Committed these changes to Testcase branch in abhihc/Squirrel (abhihc@a0770cc). Please let me know if I can push the code to abhihc/squirrel master so that reflects the code changes on this pull request.
There was a problem hiding this comment.
- If you push a commit to the master branch, it will be automatically added to this PR. So no further actions are needed 😉
- When you are writing a Javadoc comment, it might be worth to check how it will be shown to other users (your IDE should offer you various ways to see the Javadoc comment of a class). Please note that for example new line characters are removed. In your case, it means that all the text is written directly after each other (which is ok). However, you should make sure that your writing is correct, e.g., that you have ended the sentences with a point. Otherwise, the comment might be confusing for others 😉
(both are just minor comments)
There was a problem hiding this comment.
@MichaelRoeder Please let me know if I can insert point and commit again.
There was a problem hiding this comment.
@MichaelRoeder Ended the sentences with a point and made it understandable.
| <http://dbpedia.org/resource/Tonawanda_(town),_New_York> <http://www.w3.org/2002/07/owl#differentFrom> <http://dbpedia.org/resource/New_York> . | ||
| <http://dbpedia.org/resource/Ethan_A._Hitchcock_(general)> <http://dbpedia.org/ontology/deathPlace> <http://dbpedia.org/resource/New_York> . | ||
| <http://dbpedia.org/resource/Greg_Gutfeld> <http://dbpedia.org/ontology/residence> <http://dbpedia.org/resource/New_York> . | ||
| <http://dbpedia.org/resource/BDMI> <http://dbpedia.org/ontology/location> <http://dbpedia.org/resource/New_York> . |
There was a problem hiding this comment.
Test cases typically aim at certain situations. This looks like a simple copy from DBpedia. Although it does the job, it is better to a) reduce the number of triples to a number that a human can overlook fast and b) make sure that this small number covers all important cases (e.g., the usage of blank nodes or literals seems to be missing in this file).
There was a problem hiding this comment.
I have reduced the number of triples. I have added couple of faulty files to cross check the automata which cover the conditions like faulty triples and wrong syntaxes of the file.
There was a problem hiding this comment.
Nice. Could you please make sure that you have a test in which you have literals as objects? It looks like this important part is missing in the current test files.
There was a problem hiding this comment.
Do you been mean the files containing the test cases?
There was a problem hiding this comment.
Or the sample test files used as input to check the automata?
There was a problem hiding this comment.
Yes. Your current test files are focusing on URI resources as subject and object. Typically, you would also have examples with literals as objects and blank nodes as subjects and objects.
Unfortunately, these missing tests led to the problem described in the comment in the FiniteStateMachineFactory.java class.
There was a problem hiding this comment.
Ok, so the Automata's written are completely focused on triple which has the subject, object, and predicate in URI format. I focused completely on the resources which were available in the project.
…hod to closeSinkforURI method FrontierImp: changed the LOGGER.debug back to LOGGER.info when URI is good
Getting changes from master to develop
develop to robustness
Merging changes from robustness into develop
Merging changes from develop to Testcase
Merging recent changes from Testcase branch to develop branch
Final changes from develop to master
| * NTRIPLES file | ||
| */ | ||
|
|
||
| private FiniteStateMachine buildNTriplesStateMachine() { |
There was a problem hiding this comment.
@abhihc
As we discussed before during on of our meetings, having an N-triples parser is not necessary since N-triple is a subset of turtle (see https://www.w3.org/TR/n-triples/#sec-n-triples-language). So N-triple should have been covered by your turtle parser. Unfortunately, your turtle parser is only looking at the keyword @prefix (again, something that we discussed early on and warned you that this won't work).
However, the main issue with both set of rules is that they are not able to detect that the following line is a valid N-triples file:
_:alice <http://xmlns.com/foaf/0.1/knows> _:bob .
_:bob <http://xmlns.com/foaf/0.1/knows> _:alice .There was a problem hiding this comment.
Ok, so the Automata's written are completely focused on triple which has the subject, object, and predicate in URI format. I focused completely on the resources which were available in the project.
There was a problem hiding this comment.
But where is the sense in stating that we only crawl resources that we already have in our project? 😕
I asked you to have a look at the specifications of the languages and after we discussed the first ideas that you had regarding this task, I asked you again to take a look at them, e.g., to make sure that comment lines do not create issues, etc. We also discussed that your first test cases where not sufficient since you had only one simple example for each language and I asked you to add more test cases to make sure that you cover the complete language.
However, since today is the deadline for the code, I do not see a possibility to fix these issues in the remaining time 😞
There was a problem hiding this comment.
Regarding the comment lines issue, I have added the condition in the MimeTypeDetector class. But yes adding the conditions to check triple which are of other formats than URI would take time. Anyways Thanks for all the inputs.
There was a problem hiding this comment.
I was already wondering, how this "magic" works 😄
Unfortunately, adding this to the MimeTypeDetector class has two disadvantages.
- You are splitting up the definition of the languages. One part of the languages is now part of the automatons while another part is in the MimeTypeDetector class.
- You are defining lines starting with
#as general comment lines. However, this is not true for all the languages, e.g., XML. You could easily imagine a situation in which this can lead to a large amount of issues.
There was a problem hiding this comment.
Yes, I get it. I overlooked it in a generic manner.
…d the repeated fetching in HttpFetcherTest
Test scenarios to develop
Develop to master
Getting changes from Testscenarios branch to develop
Merging changes from develop to master
master to develop
develop to master
This pull request is created to merge the functionalities implemented in abhihc/Squirrel to dice-group/Squirrel.