Commit 40b93481 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Moves rdf package to utilities library

parent f8e15a18
......@@ -32,8 +32,8 @@ ext {
}
dependencies {
implementation 'org.memobase:memobase-service-utilities:1.4.0'
implementation 'org.memobase:fedora-client:0.3.0'
implementation 'org.memobase:memobase-service-utilities:1.7.0'
implementation 'org.memobase:fedora-client:0.4.1'
// Logging Framework
implementation "org.apache.logging.log4j:log4j-api:${log4jV}"
......
package org.memobase.rdf
import org.apache.jena.rdf.model.Property
import org.apache.jena.rdf.model.Resource
import org.apache.jena.rdf.model.ResourceFactory
object FEDORA {
val Container = res("Container")
val Resource = res("Resource")
val lastModifiedBy = prop("lastModifiedBy")
val createdBy = prop("createdBy")
val created = prop("created")
val lastModified = prop("lastModified")
private fun prop(name: String): Property {
return ResourceFactory.createProperty(NS.fedora, name)
}
private fun res(name: String): Resource {
return ResourceFactory.createResource(NS.fedora + name)
}
}
\ No newline at end of file
package org.memobase.rdf
import org.apache.jena.rdf.model.Property
import org.apache.jena.rdf.model.Resource
import org.apache.jena.rdf.model.ResourceFactory
object LDP {
val RDFSource = res("RDFSource")
val Container = res("Container")
val BasicContainer = res("BasicContainer")
private fun prop(name: String): Property {
return ResourceFactory.createProperty(NS.ldp, name)
}
private fun res(name: String): Resource {
return ResourceFactory.createResource(NS.ldp + name)
}
}
\ No newline at end of file
/*
* mapper-service
* Copyright (C) 2020 Memoriav
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.memobase.rdf
import org.apache.jena.rdf.model.Property
import org.apache.jena.rdf.model.ResourceFactory
object NS {
val rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
val rdfs = "http://www.w3.org/2000/01/rdf-schema#"
val owl = "http://www.w3.org/2002/07/owl#"
val skos = "http://www.w3.org/2004/02/skos/core#"
val rico = "https://www.ica.org/standards/RiC/ontology#"
val ebucore = "http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#"
val memint = "https://memobase.ch/institution/"
val memrs = "https://memobase.ch/recordSet/"
val memr = "https://memobase.ch/record/"
val mempo = "https://memobase.ch/instantiation/physical/"
val memdo = "https://memobase.ch/instantiation/digital/"
const val dc = "http://purl.org/dc/elements/1.1/"
val dcterms = "http://purl.org/dc/terms/"
val schema = "http://schema.org/"
val foaf = "http://xmlns.com/foaf/0.1/"
val wdt = "http://www.wikidata.org/prop/direct/"
val wdtn = "http://www.wikidata.org/prop/direct-normalized/"
val rdau = "http://rdaregistry.info/Elements/u/"
const val ldp = "http://www.w3.org/ns/ldp#"
const val fedora = "http://fedora.info/definitions/v4/repository#"
private const val internal = "http://memobase.ch/internal/"
val hasStatus = prop("hasStatus")
val prefixMapping = mapOf(
Pair("rdf", rdf),
Pair("rdfs", rdfs),
Pair("owl", owl),
Pair("skos", skos),
Pair("rico", rico),
Pair("ebucore", ebucore),
Pair("dc", dc),
Pair("dcterms", dcterms),
Pair("schema", schema),
Pair("foaf", foaf),
Pair("wdt", wdt),
Pair("wdtn", wdtn),
Pair("rdau", rdau)
)
private fun prop(name: String): Property {
return ResourceFactory.createProperty(NS.internal, name)
}
}
/*
* mapper-service
* Copyright (C) 2020 Memoriav
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.memobase.rdf
import org.apache.jena.rdf.model.Property
import org.apache.jena.rdf.model.Resource
import org.apache.jena.rdf.model.ResourceFactory
object RDF {
val type: Property = prop("type")
private fun prop(name: String): Property {
return ResourceFactory.createProperty(NS.rdf, name)
}
private fun res(name: String): Resource {
return ResourceFactory.createResource(NS.rdf + name)
}
}
/*
* mapper-service
* Copyright (C) 2020 Memoriav
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.memobase.rdf
import org.apache.jena.rdf.model.Property
import org.apache.jena.rdf.model.Resource
import org.apache.jena.rdf.model.ResourceFactory
object RICO {
// Classes
val Record = res("Record")
val RecordSet = res("RecordSet")
val Instantiation = res("Instantiation")
val Title = res("Title")
val Language = res("Language")
val Identifier = res("Identifier")
val Place = res("Place")
val Agent = res("Agent")
val Person = res("Person")
val CorporateBody = res("CorporateBody")
val Rule = res("Rule")
val CreationRelation = res("CreationRelation")
val SingleDate = res("SingleDate")
val DateRange = res("DateRange")
val DateSet = res("DateSet")
// datatype properties
val title: Property = prop("title")
val source: Property = prop("source")
val descriptiveNote: Property = prop("descriptiveNote")
val name: Property = prop("name")
val type: Property = prop("type")
val expressedDate: Property = prop("expressedDate")
val normalizedDateValue: Property = prop("normalizedDateValue")
val normalizedValue: Property = prop("normalizedValue")
val scopeAndContent: Property = prop("scopeAndContent")
val physicalCharacteristics: Property = prop("physicalCharacteristics")
val conditionsOfUse: Property = prop("conditionsOfUse")
val dateQualifier: Property = prop("dateQualifier")
val certainty: Property = prop("certainty")
// Object Properties
val hasTitle: Property = prop("hasTitle")
val isTitleOf: Property = prop("isTitleOf")
val hasLanguage: Property = prop("hasLanguage")
val isLanguageOf: Property = prop("isLanguageOf")
val identifiedBy: Property = prop("identifiedBy")
val identifies: Property = prop("identifies")
val identifier: Property = prop("identifier")
val hasSubject: Property = prop("hasSubject")
val publishedBy: Property = prop("publishedBy")
val heldBy: Property = prop("heldBy")
val isPartOf: Property = prop("isPartOf")
val hasProvenance: Property = prop("hasProvenance")
val instantiates: Property = prop("instantiates")
val hasInstantiation: Property = prop("hasInstantiation")
val hasDerivedInstantiation: Property = prop("hasDerivedInstantiation")
val isDerivedFromInstantiation: Property = prop("isDerivedFromInstantiation")
val creationRelationHasSource: Property = prop("creationRelationHasSource")
val creationRelationHasTarget: Property = prop("creationRelationHasTarget")
val agentIsTargetOfCreationRelation: Property = prop("agentIsTargetOfCreationRelation")
val recordResourceOrInstantiationIsSourceOfCreationRelation: Property = prop("recordResourceOrInstantiationIsSourceOfCreationRelation")
val regulates: Property = prop("regulates")
val intellectualPropertyRightsHeldBy: Property = prop("intellectualPropertyRightsHeldBy")
val regulatedBy: Property = prop("regulatedBy")
private fun prop(name: String): Property {
return ResourceFactory.createProperty(NS.rico, name)
}
private fun res(name: String): Resource {
return ResourceFactory.createResource(NS.rico + name)
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment