Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5342469
Manage REST API answer link shape
Sep 14, 2022
7174c71
Not cleaning HTML before getJsoupDoc and clean it inside for managing…
Sep 14, 2022
d00cf7a
Create a WikipediaNifExtractor extension for REST API answer
Sep 14, 2022
89c6d5c
change connector
Sep 14, 2022
6461bce
add possibility to choose connector
Sep 14, 2022
9cdeb79
deprecate class
Sep 14, 2022
29329c0
Create a MediaWikiConnector Abstract class for gathering common params
Sep 14, 2022
06202d5
Create a new connector for the REST API
Sep 14, 2022
053f0ab
Create a new connector for the REST API
Sep 14, 2022
2050875
script for creating custom dump sample
Sep 14, 2022
7ad20ae
script for generating Minidump from uri list generated by create_cust…
Sep 14, 2022
f55d803
script for creating uri list randomly from id list
Sep 14, 2022
f7686ec
adapt property files to new possible APIS
Sep 14, 2022
782214b
add new param for MWC api
Sep 14, 2022
984b5d4
new Test for abstract benchmark
Sep 14, 2022
021ca01
Add new properties for API connectors
Sep 14, 2022
7001bcd
adapt for extension
Sep 14, 2022
78d91d6
Update core/src/main/scala/org/dbpedia/extraction/util/MediawikiConne…
datalogism Sep 16, 2022
d7929da
Update dump/src/test/scala/org/dbpedia/extraction/dump/ExtractionTest…
datalogism Sep 16, 2022
167b342
Update dump/src/test/scala/org/dbpedia/extraction/dump/ExtractionTest…
datalogism Sep 16, 2022
6112b94
Update dump/src/test/scala/org/dbpedia/extraction/dump/ExtractionTest…
datalogism Sep 16, 2022
e97dd88
Update core/src/main/scala/org/dbpedia/extraction/config/Config.scala
datalogism Sep 16, 2022
969f3b4
Update core/src/main/scala/org/dbpedia/extraction/config/Config.scala
datalogism Sep 16, 2022
e89f813
clear comments of API config and fix plain abstract API urls
Sep 19, 2022
2246f21
snake case to camel case
Sep 19, 2022
da5f135
first dev on historic
Nov 4, 2022
eb68385
add last dev
Nov 21, 2022
cb076dd
ADD FIRST HISTORY PROTOTYPE
Nov 27, 2022
9f870bb
ADD final version of History prototype
Dec 6, 2022
837e402
clean
Dec 6, 2022
cb1526d
clean2
Dec 6, 2022
0f85985
Update history/ReadMe.md
datalogism Dec 7, 2022
bbf64f4
Update history/ReadMe.md
datalogism Dec 7, 2022
37376c1
Update history/src/main/scala/org/dbpedia/extraction/dump/extract/Ser…
datalogism Dec 7, 2022
9ff3818
Update dump/src/test/scala/org/dbpedia/extraction/dump/ExtractionTest…
datalogism Dec 8, 2022
8932d97
Update dump/src/test/scala/org/dbpedia/extraction/dump/ExtractionTest…
datalogism Dec 8, 2022
367dfe9
Update history/ReadMe.md
datalogism Dec 8, 2022
a8c7736
Update history/ReadMe.md
datalogism Dec 8, 2022
716a780
Update history/ReadMe.md
datalogism Dec 8, 2022
fb87924
Update history/src/main/scala/org/dbpedia/extraction/dump/extract/Ext…
datalogism Dec 8, 2022
a3a8063
Update history/src/main/scala/org/dbpedia/extraction/dump/extract/Ext…
datalogism Dec 8, 2022
376d1cc
Update history/ReadMe.md
datalogism Dec 8, 2022
b247260
Update history/ReadMe.md
datalogism Dec 8, 2022
d9c12f7
Update history/src/main/scala/org/dbpedia/extraction/dump/extract/Con…
datalogism Dec 8, 2022
4221c0f
Update history/ReadMe.md
datalogism Dec 8, 2022
a755007
Update history/ReadMe.md
datalogism Dec 8, 2022
67312b1
Update ReadMe.md
datalogism Dec 8, 2022
b08442d
Update ReadMe.md
datalogism Dec 9, 2022
4286753
Update ReadMe.md
datalogism Jan 5, 2023
a6ebbc5
Update ReadMe.md
datalogism Jan 5, 2023
f87066b
Update ReadMe.md
datalogism Jan 5, 2023
447bc7a
Update history/ReadMe.md
datalogism Jan 6, 2023
e119c8b
Update history/ReadMe.md
datalogism Jan 6, 2023
f97dafa
Update history/ReadMe.md
datalogism Jan 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,26 @@
designed for testing abstracts extractors
## Before all

* Delete tag @DoNotDiscover of ExtractionTestAbstract
* add the tag @DoNotDiscover to other test class
* Delete tag `@DoNotDiscover` of `ExtractionTestAbstract`
* add tag `@DoNotDiscover` to other test class

## Procedure :
## Procedure
1. Clean your target directory with `mvn clean` in the root directory of DIEF
1. Go to bash scripts via `cd /dump/src/test/bash`
1. OPTIONAL: Create a new Wikipedia minidump sample with `bash create_custom_sample.sh -n $numberOfPage -l $lang -d $optionalDate`
1. Process sample of Wikipedia pages `bash Minidump_custom_sample.sh -f $filename/lst`
1. Go to bash scripts via
```shell
cd /dump/src/test/bash
```
Comment on lines +11 to +14

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix incorrect cd path.

Using /dump/src/test/bash assumes a root-level directory and will fail in a cloned repo. Switch to the project-relative path instead.

-   cd /dump/src/test/bash
+   cd dump/src/test/bash
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Go to bash scripts via
```shell
cd /dump/src/test/bash
```
1. Go to bash scripts via
🤖 Prompt for AI Agents
In dump/src/test/scala/org/dbpedia/extraction/dump/ExtractionTestAbstract.md
around lines 11 to 14, the README uses an absolute path "/dump/src/test/bash"
which breaks in a cloned repo; update the instruction to use a project-relative
path such as "cd dump/src/test/bash" (no leading slash) or
"./dump/src/test/bash" so the command works from the repository root, and ensure
surrounding wording reflects that it's relative to the repo root.

1. OPTIONAL: Create a new Wikipedia minidump sample with
```shell
bash create_custom_sample.sh -n $numberOfPage -l $lang -d $optionalDate
```
1. Process sample of Wikipedia pages
```shell
bash Minidump_custom_sample.sh -f $filename/lst
```
1. Update the extraction language parameter for your minidump sample in [`extraction.nif.abstracts.properties`](https://github.com/datalogism/extraction-framework/blob/gsoc-celian/dump/src/test/resources/extraction-configs/extraction.nif.abstracts.properties) and in [`extraction.plain.abstracts.properties`](https://github.com/datalogism/extraction-framework/blob/gsoc-celian/dump/src/test/resources/extraction-configs/extraction.plain.abstracts.properties)
1. Change the name of your log in the [`ExtractionTestAbstract.scala`](https://github.com/datalogism/extraction-framework/blob/gsoc-celian/dump/src/test/scala/org/dbpedia/extraction/dump/ExtractionTestAbstract.scala) file
Comment on lines +23 to +24

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Update config links to stable in-repo paths.

Hard-coding a link to the gsoc-celian branch will 404 once that branch disappears. Use repository-relative links so the docs remain valid after merging.

-1. Update the extraction language parameter for your minidump sample in [`extraction.nif.abstracts.properties`](https://github.com/datalogism/extraction-framework/blob/gsoc-celian/dump/src/test/resources/extraction-configs/extraction.nif.abstracts.properties) and in [`extraction.plain.abstracts.properties`](https://github.com/datalogism/extraction-framework/blob/gsoc-celian/dump/src/test/resources/extraction-configs/extraction.plain.abstracts.properties)
+1. Update the extraction language parameter for your minidump sample in [`extraction.nif.abstracts.properties`](../../../../../resources/extraction-configs/extraction.nif.abstracts.properties) and in [`extraction.plain.abstracts.properties`](../../../../../resources/extraction-configs/extraction.plain.abstracts.properties)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Update the extraction language parameter for your minidump sample in [`extraction.nif.abstracts.properties`](https://github.com/datalogism/extraction-framework/blob/gsoc-celian/dump/src/test/resources/extraction-configs/extraction.nif.abstracts.properties) and in [`extraction.plain.abstracts.properties`](https://github.com/datalogism/extraction-framework/blob/gsoc-celian/dump/src/test/resources/extraction-configs/extraction.plain.abstracts.properties)
1. Change the name of your log in the [`ExtractionTestAbstract.scala`](https://github.com/datalogism/extraction-framework/blob/gsoc-celian/dump/src/test/scala/org/dbpedia/extraction/dump/ExtractionTestAbstract.scala) file
1. Update the extraction language parameter for your minidump sample in [`extraction.nif.abstracts.properties`](../../../../../resources/extraction-configs/extraction.nif.abstracts.properties) and in [`extraction.plain.abstracts.properties`](../../../../../resources/extraction-configs/extraction.plain.abstracts.properties)
1. Change the name of your log in the [`ExtractionTestAbstract.scala`](https://github.com/datalogism/extraction-framework/blob/gsoc-celian/dump/src/test/scala/org/dbpedia/extraction/dump/ExtractionTestAbstract.scala) file
🤖 Prompt for AI Agents
In dump/src/test/scala/org/dbpedia/extraction/dump/ExtractionTestAbstract.md
around lines 23 to 24, the documentation links point to the external gsoc-celian
branch which will break; update both links to use stable repository-relative
paths (relative paths to the files in the current repo) so they resolve after
merging, and change the link to ExtractionTestAbstract.scala likewise to a
repository-relative path; ensure the links point to
src/test/resources/extraction-configs/extraction.nif.abstracts.properties,
src/test/resources/extraction-configs/extraction.plain.abstracts.properties and
src/test/scala/org/dbpedia/extraction/dump/ExtractionTestAbstract.scala using
relative URLs rather than a branch-qualified absolute URL.

1. Rebuild the app with `mvn install`, or just test it with `mvn test -Dtest="ExtractionTestAbstract2"`
1. Rebuild the app with `mvn install`, or just test it with
```shell
mvn test -Dtest="ExtractionTestAbstract2"
```
28 changes: 14 additions & 14 deletions history/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DBpedia History enables the history of a Wikipedia chapter to be extracted into

## Previous work

This DBpedia App is a scala/java version of the first work conducted by the French Chapter : https://github.com/dbpedia/Historic/
This DBpedia App is a Scala/Java version of the first work conducted by the French Chapter, <https://github.com/dbpedia/Historic/>.

Fabien Gandon, Raphael Boyer, Olivier Corby, Alexandre Monnin. Wikipedia editing history in DBpedia: extracting and publishing the encyclopedia editing activity as linked data. IEEE/WIC/ACM International Joint Conference on Web Intelligence (WI' 16), Oct 2016, Omaha, United States. <hal-01359575>
https://hal.inria.fr/hal-01359575
Expand All @@ -15,26 +15,26 @@ https://hal.inria.fr/hal-01359583

## A first working prototype

This prototype is not optimized, during its development of it we were faced with the WikiPage type checking constraints that are checked in almost every module of the DBpedia pipeline.
We hardly copy/paste and renamed all the classes and objects we needed for running the extractors.
This conception could be easily improved by making WikiPage and WikiPageWithRevision objects inherit from the same abstract object.
But as a first step, we wanted to touch the less possible DBpedia core module.
This prototype is not optimized. During its development, we were faced with the WikiPage type-checking constraints that are checked in almost every module of the DBpedia pipeline.
We basically copy/pasted and renamed all the classes and objects we needed for running the extractors.
This conception could be easily improved by making `WikiPage` and `WikiPageWithRevision` objects inherit from the same abstract object.
But as a first step, we didn't want to impact the core module.

Some other improvements that could be conducted:
Some other improvements that could be made:
* Scala version
* Being able to use a historic namespace taking into account the DBpedia chapter language
* Being able to follow if a revision impacts an infobox content
* Enabling use of a historic namespace, taking into account the DBpedia chapter language
* Enabling following when a revision impacts content of an `infobox`

## Main Class

* [WikipediaDumpParserHistory.java](src/main/java/org/dbpedia/extraction/sources/WikipediaDumpParserHistory.java) : for parsing of the history dumps
* [RevisionNode.scala](src/main/scala/org/dbpedia/extraction/wikiparser/RevisionNode.scala) : define revision node object
* [WikiPageWithRevision](src/main/scala/org/dbpedia/extraction/wikiparser/WikiPageWithRevisions.scala) : define wikipage with revision list object
* [WikipediaDumpParserHistory.java](src/main/java/org/dbpedia/extraction/sources/WikipediaDumpParserHistory.java) for parsing the history dumps
* [RevisionNode.scala](src/main/scala/org/dbpedia/extraction/wikiparser/RevisionNode.scala) define revision of node object
* [WikiPageWithRevision](src/main/scala/org/dbpedia/extraction/wikiparser/WikiPageWithRevisions.scala) define `wikipage` with revision list object

Comment on lines +28 to +33

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Pluralize heading and fix class name/link text

“Main Class” → “Main classes”; link text should match file name (Revisions).

-## Main Class
+## Main classes
@@
-* [WikiPageWithRevision](src/main/scala/org/dbpedia/extraction/wikiparser/WikiPageWithRevisions.scala) — define `wikipage` with revision list object 
+* [WikiPageWithRevisions](src/main/scala/org/dbpedia/extraction/wikiparser/WikiPageWithRevisions.scala) — define `WikiPage` with a list of revisions
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Main Class
* [WikipediaDumpParserHistory.java](src/main/java/org/dbpedia/extraction/sources/WikipediaDumpParserHistory.java) — for parsing the history dumps
* [RevisionNode.scala](src/main/scala/org/dbpedia/extraction/wikiparser/RevisionNode.scala) — define revision of node object
* [WikiPageWithRevision](src/main/scala/org/dbpedia/extraction/wikiparser/WikiPageWithRevisions.scala) — define `wikipage` with revision list object
## Main classes
* [WikipediaDumpParserHistory.java](src/main/java/org/dbpedia/extraction/sources/WikipediaDumpParserHistory.java) — for parsing the history dumps
* [RevisionNode.scala](src/main/scala/org/dbpedia/extraction/wikiparser/RevisionNode.scala) — define revision of node object
* [WikiPageWithRevisions](src/main/scala/org/dbpedia/extraction/wikiparser/WikiPageWithRevisions.scala) — define `WikiPage` with a list of revisions
🤖 Prompt for AI Agents
In history/ReadMe.md around lines 28 to 33, change the heading "Main Class" to
"Main classes" and update the link text and short descriptions so they match the
actual file names and plurals: ensure the RevisionNode entry and the
WikiPageWithRevisions entry use the exact file names (RevisionNode.scala and
WikiPageWithRevisions.scala) and adjust their description wording to use plural
"revisions" where appropriate.

## Extractors

* [HistoryPageExtractor.scala](src/main/scala/org/dbpedia/extraction/mappings/HistoryPageExtractor.scala): Extract all the revision of every wikipedia pages
* [HistoryStatsExtractor.scala](src/main/scala/org/dbpedia/extraction/mappings/HistoryStatsExtractor.scala) : Extract statistics about the revision activity for every page of Wikipedia
* [HistoryPageExtractor.scala](src/main/scala/org/dbpedia/extraction/mappings/HistoryPageExtractor.scala)Extract all revisions of every Wikipedia page
* [HistoryStatsExtractor.scala](src/main/scala/org/dbpedia/extraction/mappings/HistoryStatsExtractor.scala) Extract statistics about revision activity for every page of Wikipedia

## How to run it ?

Expand All @@ -48,4 +48,4 @@ Some other improvements that could be conducted:
* configure the [extraction.properties](extraction.properties) file
* and run ```../run run extraction.properties```

* Test it with : mvn test (need to have a containing file frwiki-[YYYYMMDD]-download-complete empty flag file into the base-dir defined into the extraction-properties file )
* Test it with `mvn test` (need to have a containing file, `frwiki-[YYYYMMDD]-download-complete` empty flag file into the `base-dir` defined into the `extraction-properties` file)
Comment thread
datalogism marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class ConfigLoader2(config: Config2)
/**
* Loads the configuration and creates extraction jobs for all configured languages.
*
* @return Non-strict Traversable over all configured extraction jobs i.e. an extractions job will not be created until it is explicitly requested.
* @return Non-strict Traversable over all configured extraction jobs, i.e., an extraction job will not be created until it is explicitly requested.
*/
def getExtractionJobs: Traversable[ExtractionJob2] =
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.dbpedia.extraction.wikiparser.{Namespace, WikiPage, WikiPageWithRevis
* @param source The extraction source
* @param namespaces Only extract pages in these namespaces
* @param destination The extraction destination. Will be closed after the extraction has been finished.
* @param language the language of this extraction.
* @param language The language of this extraction.
*/
class ExtractionJob2(
extractor: WikiPageWithRevisionsExtractor,
Expand Down Expand Up @@ -44,7 +44,7 @@ class ExtractionJob2(
println(graph.toString())
destination.write(graph)
}
Comment on lines +41 to +46

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Remove per-page println debug output

println("SimpleWorkers"), println(extractor.toString) and especially println(graph.toString()) fire for every page. On real dumps this produces massive console spam and forces the whole graph into a string, severely hurting throughput. Please drop these debug prints (or guard them behind a proper logger flag) before merging.

-        println("SimpleWorkers")
-        println(extractor.toString)
         val graph = extractor.extract(page, page.uri)
-        println(graph.toString())
         destination.write(graph)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
println("SimpleWorkers")
println(extractor.toString)
val graph = extractor.extract(page, page.uri)
println(graph.toString())
destination.write(graph)
}
val graph = extractor.extract(page, page.uri)
destination.write(graph)
}
🤖 Prompt for AI Agents
In
history/src/main/scala/org/dbpedia/extraction/dump/extract/ExtractionJob2.scala
around lines 41 to 46, remove the per-page println debug statements
(println("SimpleWorkers"), println(extractor.toString),
println(graph.toString())) because they log every page and force graph->String
conversion; either delete these lines or replace them with calls to a proper
logger at debug/trace level that are guarded by a configuration flag so they are
not executed in normal/production runs.

//if the internal extraction process of this extractor yielded extraction records (e.g. non critical errors etc.), those will be forwarded to the ExtractionRecorder, else a new record is produced
//if the internal extraction process of this extractor yielded extraction records (e.g., non-critical errors, etc.), those will be forwarded to the ExtractionRecorder; else, a new record is produced
val records = page.getExtractionRecords() match{
case seq :Seq[RecordEntry2[WikiPageWithRevisions]] if seq.nonEmpty => seq
case _ => Seq(new RecordEntry2[WikiPageWithRevisions](page, page.uri, RecordSeverity.Info, page.title.language))
Expand Down