Skip to content

Merging final developments into dice-group master#97

Merged
MichaelRoeder merged 48 commits into
dice-group:developForMerging2from
abhihc:master
Jun 11, 2019
Merged

Merging final developments into dice-group master#97
MichaelRoeder merged 48 commits into
dice-group:developForMerging2from
abhihc:master

Conversation

@abhihc

@abhihc abhihc commented Jan 23, 2019

Copy link
Copy Markdown

This pull request is created to merge the functionalities implemented in abhihc/Squirrel to dice-group/Squirrel.

abhihc and others added 24 commits October 24, 2018 11:26
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
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
MichaelRoeder changed the base branch from master to developForMerging2 January 24, 2019 12:08

@MichaelRoeder MichaelRoeder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left several comments pointing out necessary improvements.

<constructor-arg index="2" value="" />
</bean>

</beans>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abhihc@46f55df

Commit ID

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK so the issue has been resolved.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the test generating crawleable URI objects for 4 classes but is checking only one single class?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaelRoeder could you please elaborate on this comment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaelRoeder Yes ok. Will add the above two lines to display what I am fetching.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. 😉

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@MichaelRoeder MichaelRoeder Jan 25, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. If you push a commit to the master branch, it will be automatically added to this PR. So no further actions are needed 😉
  2. 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaelRoeder Please let me know if I can insert point and commit again.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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> .

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you been mean the files containing the test cases?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or the sample test files used as input to check the automata?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread squirrel.worker/src/test/resources/rdf_analyzer/new_york/RDFXML Outdated
ajrox090 and others added 7 commits January 24, 2019 17:20
Getting changes from master to develop
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() {

@MichaelRoeder MichaelRoeder Jan 25, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 .

See https://www.w3.org/TR/n-triples/#BNodes

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😞

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was already wondering, how this "magic" works 😄

Unfortunately, adding this to the MimeTypeDetector class has two disadvantages.

  1. 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.
  2. 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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I get it. I overlooked it in a generic manner.

@MichaelRoeder
MichaelRoeder merged commit 97801ab into dice-group:developForMerging2 Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants