test for carare

This commit is contained in:
Alessia Bardi 2023-01-11 14:51:54 +01:00
parent 22976a6983
commit e356f50ad7
3 changed files with 48 additions and 33 deletions

View File

@ -56,6 +56,17 @@ public class ApplyX3MappingTest {
x3mEngine.execute(); x3mEngine.execute();
} }
@Test
public void testCarareCollection() throws MalformedURLException {
X3MLEngineFactory x3mEngine = X3MLEngineFactory.create()
.withMappings(new URL("https://mapping.d4science.org/3MEditor/Services?id=1010&output=text/xml&method=export"))
.withVerboseLogging()
.withGeneratorPolicy(getInputStreamFromClasspath("/eu/dnetlib/x3m/ariadne_policy.xml"))
.withInput(getInputStreamFromClasspath("/eu/dnetlib/x3m/carare_collection.xml"))
.withOutput(System.out, X3MLEngineFactory.OutputFormat.RDF_XML);
x3mEngine.execute();
}
public void doBasicTest(String policyPath, String recordPath) throws IOException { public void doBasicTest(String policyPath, String recordPath) throws IOException {

View File

@ -1,51 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<generator_policy> <generator_policy>
<!-- ARIADNEplus Generator Policy version 1.5 --> <!-- ARIADNEplus Generator Policy version 1.10 -->
<!-- The prefix is a namespace that must be declared in the X3ML definition.
<!-- The prefix is a namespace that must be declared in the X3ML definition. in the x3ml define <namespace prefix="ariadneplus" uri="https://ariadne-infrastructure.eu/aocat/"/> -->
in the x3ml define <namespace prefix="ariadneplus" uri="https://ariadne-infrastructure.eu/aocat/"/> -->
<generator name="CollectionURI" prefix="ariadneplus" shorten="yes"> <generator name="CollectionURI" prefix="ariadneplus" shorten="yes">
<pattern>Collection/{term}</pattern> <pattern>Collection/{term}</pattern>
</generator> </generator>
<generator name="CollectionURI-2" prefix="ariadneplus" shorten="yes"> <generator name="CollectionURI-2" prefix="ariadneplus" shorten="yes">
<pattern>Collection/{provider}/{term}</pattern> <pattern>Collection/{provider}/{term}</pattern>
</generator> </generator>
<generator name="DataResourceURI" prefix="ariadneplus" shorten="yes"> <generator name="DataResourceURI" prefix="ariadneplus" shorten="yes">
<pattern>Resource/{term}</pattern> <pattern>Resource/{term}</pattern>
</generator> </generator>
<generator name="DataResourceURI-2" prefix="ariadneplus" shorten="yes"> <generator name="DataResourceURI-2" prefix="ariadneplus" shorten="yes">
<pattern>Resource/{provider}/{term}</pattern> <pattern>Resource/{provider}/{term}</pattern>
</generator> </generator>
<generator name="ObjectURI" prefix="ariadneplus" shorten="yes"> <generator name="ObjectURI" prefix="ariadneplus" shorten="yes">
<pattern>Object/{resource}-{term}</pattern> <pattern>Object/{resource}-{term}</pattern>
</generator> </generator>
<generator name="ObjectURI-2" prefix="ariadneplus" shorten="yes"> <generator name="ObjectURI-2" prefix="ariadneplus" shorten="yes">
<pattern>Object/{arg1}/{arg2}</pattern> <pattern>Object/{arg1}/{arg2}</pattern>
</generator> </generator>
<generator name="ObjectLabel"> <generator name="ObjectLabel">
<pattern>Resource {resource} is about object {term}</pattern> <pattern>Resource {resource} is about object {term}</pattern>
</generator> </generator>
<generator name="IdentifierURI" prefix="ariadneplus"> <generator name="IdentifierURI" prefix="ariadneplus">
<pattern>Identifier/{term}</pattern> <pattern>Identifier/{term}</pattern>
</generator> </generator>
<generator name="DocumentURI" prefix="ariadneplus" shorten="yes">
<generator name="DocumentURI" prefix="ariadneplus" shorten="yes">>
<pattern>Document/{term}</pattern> <pattern>Document/{term}</pattern>
</generator> </generator>
<generator name="DocumentURI-2" prefix="ariadneplus" shorten="yes"> <generator name="DocumentURI-2" prefix="ariadneplus" shorten="yes">
<pattern>Document/{provider}/{term}</pattern> <pattern>Document/{provider}/{term}</pattern>
</generator> </generator>
<generator name="EventURI" prefix="ariadneplus" shorten="yes"> <generator name="EventURI" prefix="ariadneplus" shorten="yes">
<pattern>Event/{resource}-{term}</pattern> <pattern>Event/{resource}-{term}</pattern>
</generator> </generator>
@ -70,7 +56,7 @@
<generator name="PlaceURI-2" prefix="ariadneplus" shorten="yes"> <generator name="PlaceURI-2" prefix="ariadneplus" shorten="yes">
<pattern>Place/{arg1}/{arg2}</pattern> <pattern>Place/{arg1}/{arg2}</pattern>
</generator> </generator>
<generator name="AgentURI" prefix="ariadneplus" > <generator name="AgentURI" prefix="ariadneplus">
<pattern>Agent/{term}</pattern> <pattern>Agent/{term}</pattern>
</generator> </generator>
<generator name="AgentURI-short" prefix="ariadneplus" shorten="yes"> <generator name="AgentURI-short" prefix="ariadneplus" shorten="yes">
@ -82,65 +68,63 @@
<generator name="OrgURI" prefix="ariadneplus"> <generator name="OrgURI" prefix="ariadneplus">
<pattern>Organisation/{term}</pattern> <pattern>Organisation/{term}</pattern>
</generator> </generator>
<generator name="ConceptURI" prefix="ariadneplus"> <generator name="ConceptURI" prefix="ariadneplus">
<pattern>Concept/{term}</pattern> <pattern>Concept/{term}</pattern>
</generator> </generator>
<generator name="ConceptURI-2" prefix="ariadneplus"> <generator name="ConceptURI-2" prefix="ariadneplus">
<pattern>Concept/{scheme}/{term}</pattern> <pattern>Concept/{scheme}/{term}</pattern>
</generator> </generator>
<generator name="ConceptURI-3" prefix="ariadneplus"> <generator name="ConceptURI-3" prefix="ariadneplus">
<pattern>Concept/{db}/{scheme}/{term}</pattern> <pattern>Concept/{db}/{scheme}/{term}</pattern>
</generator> </generator>
<generator name="ConceptURI-2-short" prefix="ariadneplus" shorten="yes"> <generator name="ConceptURI-2-short" prefix="ariadneplus" shorten="yes">
<pattern>Concept/{scheme}/{term}</pattern> <pattern>Concept/{scheme}/{term}</pattern>
</generator> </generator>
<generator name="LangURI" prefix="lexvo"> <generator name="LangURI" prefix="lexvo">
<pattern>{term}</pattern> <pattern>{term}</pattern>
</generator> </generator>
<generator name="OneLevelCustomURI" prefix="ariadneplus"> <generator name="OneLevelCustomURI" prefix="ariadneplus">
<pattern>{level1}/{term}</pattern> <pattern>{level1}/{term}</pattern>
</generator> </generator>
<generator name="TwoLevelCustomURI" prefix="ariadneplus"> <generator name="TwoLevelCustomURI" prefix="ariadneplus">
<pattern>{level1}/{level2}/{term}</pattern> <pattern>{level1}/{level2}/{term}</pattern>
</generator> </generator>
<generator name="GraveURI-2" prefix="ariadneplus">
<pattern>Grave/{provider}/{term}</pattern>
</generator>
<generator name="BurialURI-2" prefix="ariadneplus">
<pattern>Burial/{provider}/{term}</pattern>
</generator>
<generator name="FindsURI-2" prefix="ariadneplus">
<pattern>Finds/{provider}/{term}</pattern>
</generator>
<generator name="SimpleLabel"> <generator name="SimpleLabel">
<pattern>{label}</pattern> <pattern>{label}</pattern>
</generator> </generator>
<generator name="CompositeLabel"> <generator name="CompositeLabel">
<pattern>{label} {text}</pattern> <pattern>{label} {text}</pattern>
</generator> </generator>
<generator name="URIorUUID"> <generator name="URIorUUID">
<custom generatorClass="gr.forth.URIorUUID"> <custom generatorClass="gr.forth.URIorUUID">
<set-arg name="text"/> <set-arg name="text"/>
</custom> </custom>
</generator> </generator>
<generator name="URNfromTextualContent"> <generator name="URNfromTextualContent">
<custom generatorClass="gr.forth.TextualContent"> <custom generatorClass="gr.forth.TextualContent">
<set-arg name="text" type="xpath"/> <set-arg name="text" type="xpath"/>
</custom> </custom>
</generator> </generator>
<generator name="TypedLiteralGen"> <generator name="TypedLiteralGen">
<custom generatorClass="gr.forth.TypedLiteralGenerator"> <custom generatorClass="gr.forth.TypedLiteralGenerator">
<set-arg name="text"/> <set-arg name="text"/>
</custom> </custom>
</generator> </generator>
<generator name="ConcatMultipleTerms1"> <generator name="ConcatMultipleTerms1">
<custom generatorClass="gr.forth.ConcatMultipleTerms"> <custom generatorClass="gr.forth.ConcatMultipleTerms">
<set-arg name="prefix" type="constant"/> <set-arg name="prefix" type="constant"/>
<set-arg name="delimiter" type="constant"/> <set-arg name="sameTermsDelim" type="constant"/>
<set-arg name="diffTermsDelim" type="constant"/>
<set-arg name="text1"/> <set-arg name="text1"/>
</custom> </custom>
</generator> </generator>
</generator_policy>
</generator_policy>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<record xmlns:dc="http://purl.org/dc/elements/1.1/" type="collection">
<dc:title>Sites and Monuments Record (SMR), Ireland</dc:title>
<dc:identifier>https://archaeology.ie/archaeological-survey-ireland</dc:identifier>
<dc:source>National Monuments Service, Department of Housing, Local Government and Heritage</dc:source>
<dc:description>The SMR contains details of all monuments and places (sites) where it is believed there is a
monument known to the ASI pre-dating AD 1700 and also includes a selection of monuments from the post-AD 1700
period. There are in excess of 150,800 records in the database and over 138,800 of these relate to
archaeological monuments. The remaining 12,000 records are classified as Redundant record: the majority of
these relate to obsolete terms, records or features that are not monuments.
</dc:description>
<dc:publisher>National Monuments Service, Department of Housing, Local Government and Heritage, Republic of
Ireland
</dc:publisher>
<date_created>Tue July 21 12:00:00 BST 2022</date_created>
<date_modified>Tue July 21 12:00:00 BST 2022</date_modified>
<dc:format>Dataset Collection</dc:format>
<dc:language>eng</dc:language>
<dc:rights>https://archaeology.ie/archaeological-survey-ireland/historic-environment-viewer-application</dc:rights>
</record>