-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ARCH text files derivatives. (#541)
- Add css, html, js, json, plain text, and xml information extraction methods - Add app extractors - Add Python implementation of extractors - Add tests - Resolves #540 - Fix for MIME types with extra data. - Resolves #542 - Update Tika to 1.23
- Loading branch information
Showing
22 changed files
with
1,418 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/scala/io/archivesunleashed/app/CssInformationExtractor.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright © 2017 The Archives Unleashed Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.archivesunleashed.app | ||
|
||
import io.archivesunleashed.ArchiveRecord | ||
import io.archivesunleashed.df.DataFrameLoader | ||
import org.apache.spark.sql.{DataFrame, Dataset, Row, SparkSession} | ||
|
||
object CssInformationExtractor { | ||
|
||
/** Extract web graph from web archive using DataFrame and Spark SQL. | ||
* | ||
* @param d DataFrame obtained from RecordLoader | ||
* @return Dataset[Row], where the schema is (crawl date, src, image url, | ||
* alt text) | ||
*/ | ||
def apply(d: DataFrame): Dataset[Row] = { | ||
val spark = SparkSession.builder().master("local").getOrCreate() | ||
d | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/scala/io/archivesunleashed/app/HtmlInformationExtractor.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright © 2017 The Archives Unleashed Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.archivesunleashed.app | ||
|
||
import io.archivesunleashed.ArchiveRecord | ||
import io.archivesunleashed.df.DataFrameLoader | ||
import org.apache.spark.sql.{DataFrame, Dataset, Row, SparkSession} | ||
|
||
object HtmlInformationExtractor { | ||
|
||
/** Extract web graph from web archive using DataFrame and Spark SQL. | ||
* | ||
* @param d DataFrame obtained from RecordLoader | ||
* @return Dataset[Row], where the schema is (crawl date, src, image url, | ||
* alt text) | ||
*/ | ||
def apply(d: DataFrame): Dataset[Row] = { | ||
val spark = SparkSession.builder().master("local").getOrCreate() | ||
d | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/scala/io/archivesunleashed/app/JsInformationExtractor.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright © 2017 The Archives Unleashed Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.archivesunleashed.app | ||
|
||
import io.archivesunleashed.ArchiveRecord | ||
import io.archivesunleashed.df.DataFrameLoader | ||
import org.apache.spark.sql.{DataFrame, Dataset, Row, SparkSession} | ||
|
||
object JsInformationExtractor { | ||
|
||
/** Extract web graph from web archive using DataFrame and Spark SQL. | ||
* | ||
* @param d DataFrame obtained from RecordLoader | ||
* @return Dataset[Row], where the schema is (crawl date, src, image url, | ||
* alt text) | ||
*/ | ||
def apply(d: DataFrame): Dataset[Row] = { | ||
val spark = SparkSession.builder().master("local").getOrCreate() | ||
d | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/scala/io/archivesunleashed/app/JsonInformationExtractor.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright © 2017 The Archives Unleashed Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.archivesunleashed.app | ||
|
||
import io.archivesunleashed.ArchiveRecord | ||
import io.archivesunleashed.df.DataFrameLoader | ||
import org.apache.spark.sql.{DataFrame, Dataset, Row, SparkSession} | ||
|
||
object JsonInformationExtractor { | ||
|
||
/** Extract web graph from web archive using DataFrame and Spark SQL. | ||
* | ||
* @param d DataFrame obtained from RecordLoader | ||
* @return Dataset[Row], where the schema is (crawl date, src, image url, | ||
* alt text) | ||
*/ | ||
def apply(d: DataFrame): Dataset[Row] = { | ||
val spark = SparkSession.builder().master("local").getOrCreate() | ||
d | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/scala/io/archivesunleashed/app/PlainTextInformationExtractor.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright © 2017 The Archives Unleashed Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.archivesunleashed.app | ||
|
||
import io.archivesunleashed.ArchiveRecord | ||
import io.archivesunleashed.df.DataFrameLoader | ||
import org.apache.spark.sql.{DataFrame, Dataset, Row, SparkSession} | ||
|
||
object PlainTextInformationExtractor { | ||
|
||
/** Extract web graph from web archive using DataFrame and Spark SQL. | ||
* | ||
* @param d DataFrame obtained from RecordLoader | ||
* @return Dataset[Row], where the schema is (crawl date, src, image url, | ||
* alt text) | ||
*/ | ||
def apply(d: DataFrame): Dataset[Row] = { | ||
val spark = SparkSession.builder().master("local").getOrCreate() | ||
d | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/scala/io/archivesunleashed/app/XmlInformationExtractor.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright © 2017 The Archives Unleashed Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.archivesunleashed.app | ||
|
||
import io.archivesunleashed.ArchiveRecord | ||
import io.archivesunleashed.df.DataFrameLoader | ||
import org.apache.spark.sql.{DataFrame, Dataset, Row, SparkSession} | ||
|
||
object XmlInformationExtractor { | ||
|
||
/** Extract web graph from web archive using DataFrame and Spark SQL. | ||
* | ||
* @param d DataFrame obtained from RecordLoader | ||
* @return Dataset[Row], where the schema is (crawl date, src, image url, | ||
* alt text) | ||
*/ | ||
def apply(d: DataFrame): Dataset[Row] = { | ||
val spark = SparkSession.builder().master("local").getOrCreate() | ||
d | ||
} | ||
} |
Oops, something went wrong.