diff --git a/.gitignore b/.gitignore index 82a8de8186..2ce6c86803 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,8 @@ salsah1/project webapi/project webapi/_fuseki/run webapi/build +upgrade/project +upgrade/target triplestores/graphdb-se-7 idea.vmoptions sipi/test diff --git a/.travis.yml b/.travis.yml index 738e62ebb3..39aea7c27c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,7 @@ jobs: # - sbt knora-sipi/docker:publish # - sbt knora-graphdb-se/docker:publish # - sbt knora-graphdb-free/docker:publish - # - sbt knora-upgrade/docker:publish + # - sbt upgrade/docker:publish # - sbt knora-assets/docker:publish # unit tests - stage: test @@ -103,9 +103,27 @@ jobs: # upgrade tests - stage: test script: - # run tests - - pyenv shell 3.7.1 - - cd $TRAVIS_BUILD_DIR/upgrade && pip3 install -r requirements.txt && ./test.sh + # build all docker images + - make build-all-images + # prepare needed graphdb-se files + - mkdir -p $TRAVIS_BUILD_DIR/graphdb + - cp $TRAVIS_BUILD_DIR/travis/graphdb.license $TRAVIS_BUILD_DIR/graphdb/graphdb.license + - cp $TRAVIS_BUILD_DIR/webapi/scripts/KnoraRules.pie $TRAVIS_BUILD_DIR/graphdb + # start and initialize graphdb-se + - docker network create knora-net + - docker run --rm -d --name=db --network=knora-net -p 127.0.0.1:7200:7200 -v $TRAVIS_BUILD_DIR/graphdb:/graphdb -e GDB_HEAP_SIZE=$GDB_HEAP_SIZE daschswiss/knora-graphdb-se -Dgraphdb.license.file=/graphdb/graphdb.license + - sleep 5 + - make init-db-test-minimal + # load v7.0.0 data and run auto-upgrade (sbt use case) + - cd $TRAVIS_BUILD_DIR/upgrade/graphdb-se + - unzip $TRAVIS_BUILD_DIR/test-data/v7.0.0/v7.0.0-knora-test.trig.zip + - ./empty-repository.sh -r knora-test -u gaga -p gaga -h localhost:7200 + - ./upload-repository.sh -r knora-test -u gaga -p gaga -h localhost:7200 v7.0.0-knora-test.trig + - ./auto-upgrade.sh -r knora-test -u gaga -p gaga -h localhost:7200 -t /tmp/upgrade.dir + # load v7.0.0 data and run auto-upgrade (docker use case) + - ./empty-repository.sh -r knora-test -u gaga -p gaga -h localhost:7200 + - ./upload-repository.sh -r knora-test -u gaga -p gaga -h localhost:7200 v7.0.0-knora-test.trig + - docker run -it --rm --network=knora-net -v /tmp:/tmp -e KNORA_UPGRADE_DOCKER=true daschswiss/knora-upgrade -r knora-test -u gaga -p gaga -h db:7200 -t /tmp/upgrade.dir # testing docs generation - stage: test script: @@ -141,9 +159,9 @@ jobs: # when on 'develop' then $TRAVIS_BRANCH = develop # when on 'tag' then $TRAVIS_BRANCH = tag, e.g., v1.2.0 - docker login -u $DOCKER_USER -p $DOCKER_PASS - # webapi + # knora-api - sbt webapi/docker:publish - # salsah1 + # knora-salsah1 - sbt salsah1/docker:publish # knora-sipi - sbt knora-sipi/docker:publish @@ -152,7 +170,7 @@ jobs: # knora-graphdb-free - sbt knora-graphdb-free/docker:publish # knora-upgrade - - sbt knora-upgrade/docker:publish + - sbt upgrade/docker:publish # knora-assets - sbt knora-assets/docker:publish # publish images to daschswiss dockerhub organization diff --git a/KnoraBuild.sbt b/KnoraBuild.sbt index 98a0e935e4..d8ea09b1df 100644 --- a/KnoraBuild.sbt +++ b/KnoraBuild.sbt @@ -23,68 +23,69 @@ lazy val buildSettings = Dependencies.Versions ++ Seq( version := (ThisBuild / version).value ) -lazy val root = Project(id = "knora", file(".")) - .aggregate(aggregatedProjects: _*) - .enablePlugins(DockerComposePlugin, GitVersioning, GitBranchPrompt) - .settings(Dependencies.Versions) - .settings( - // values set for all sub-projects - // These are normal sbt settings to configure for release, skip if already defined +lazy val rootBaseDir = baseDirectory.in(ThisBuild) - ThisBuild / licenses := Seq("AGPL-3.0" -> url("https://opensource.org/licenses/AGPL-3.0")), - ThisBuild / homepage := Some(url("https://github.com/dhlab-basel/Knora")), - ThisBuild / scmInfo := Some(ScmInfo(url("https://github.com/dhlab-basel/Knora"), "scm:git:git@github.com:dhlab-basel/Knora.git")), +lazy val root: Project = Project(id = "knora", file(".")) + .aggregate(aggregatedProjects: _*) + .enablePlugins(DockerComposePlugin, GitVersioning, GitBranchPrompt) + .settings(Dependencies.Versions) + .settings( + // values set for all sub-projects + // These are normal sbt settings to configure for release, skip if already defined - // use 'git describe' for deriving the version - git.useGitDescribe := true, + ThisBuild / licenses := Seq("AGPL-3.0" -> url("https://opensource.org/licenses/AGPL-3.0")), + ThisBuild / homepage := Some(url("https://github.com/dhlab-basel/Knora")), + ThisBuild / scmInfo := Some(ScmInfo(url("https://github.com/dhlab-basel/Knora"), "scm:git:git@github.com:dhlab-basel/Knora.git")), - // override generated version string because docker hub rejects '+' in tags - ThisBuild / version ~= (_.replace('+', '-')), + // use 'git describe' for deriving the version + git.useGitDescribe := true, - // use Ctrl-c to stop current task but not quit SBT - Global / cancelable := true, + // override generated version string because docker hub rejects '+' in tags + ThisBuild / version ~= (_.replace('+', '-')), - publish / skip := true, + // use Ctrl-c to stop current task but not quit SBT + Global / cancelable := true, - Dependencies.sysProps := sys.props.toString(), - Dependencies.sysEnvs := sys.env.toString(), + publish / skip := true, - // these can be set by the user as system environment variables - ThisBuild / Dependencies.gdbHomePath := sys.env.getOrElse("KNORA_GDB_HOME", sys.props("user.dir") + "/triplestores/graphdb/home"), - ThisBuild / Dependencies.gdbLicensePath := sys.env.getOrElse("KNORA_GDB_LICENSE", sys.props("user.dir") + "/triplestores/graphdb/graphdb.license"), + Dependencies.sysProps := sys.props.toString(), + Dependencies.sysEnvs := sys.env.toString(), - // these are calculated in their respective targets - Dependencies.knoraSipiImage := "dhlabbasel/knora-sipi:" + version.value, - Dependencies.knoraGdbImage := { - if (Dependencies.gdbTypeString.equals("graphdb-free")) { - "dhlabbasel/knora-graphdb-free:" + version.value - } else { - "dhlabbasel/knora-graphdb-se:" + version.value - } - }, - Dependencies.knoraWebapiImage := "dhlabbasel/webapi:" + version.value, - Dependencies.knoraSalsah1Image := "dhlabbasel/salsah1:" + version.value, - - // use these values for variable substitution in the docker-compose.yml - variablesForSubstitution := Map( - "KNORA_GDB_HOME" -> Dependencies.gdbHomePath.value, - "KNORA_GDB_LICENSE" -> Dependencies.gdbLicensePath.value, - "KNORA_GDB_TYPE" -> Dependencies.gdbTypeString, - "KNORA_GDB_IMAGE" -> Dependencies.knoraGdbImage.value, - "KNORA_SIPI_IMAGE" -> Dependencies.knoraSipiImage.value, - "KNORA_WEBAPI_IMAGE" -> Dependencies.knoraWebapiImage.value, - "KNORA_SALSAH1_IMAGE" -> Dependencies.knoraSalsah1Image.value - ), + // these can be set by the user as system environment variables + ThisBuild / Dependencies.gdbHomePath := sys.env.getOrElse("KNORA_GDB_HOME", sys.props("user.dir") + "/triplestores/graphdb/home"), + ThisBuild / Dependencies.gdbLicensePath := sys.env.getOrElse("KNORA_GDB_LICENSE", sys.props("user.dir") + "/triplestores/graphdb/graphdb.license"), - dockerImageCreationTask := Seq( - (salsah1 / Docker / publishLocal).value, - (webapi / Docker / publishLocal).value, - (knoraGraphDbSe / Docker / publishLocal).value, - (knoraGraphdbFree / Docker / publishLocal).value, - (knoraSipi / Docker / publishLocal).value, - (knoraAssets / Docker / publishLocal).value - ) - ) + // these are calculated in their respective targets + Dependencies.knoraSipiImage := "dhlabbasel/knora-sipi:" + version.value, + Dependencies.knoraGdbImage := { + if (Dependencies.gdbTypeString.equals("graphdb-free")) { + "dhlabbasel/knora-graphdb-free:" + version.value + } else { + "dhlabbasel/knora-graphdb-se:" + version.value + } + }, + Dependencies.knoraWebapiImage := "dhlabbasel/webapi:" + version.value, + Dependencies.knoraSalsah1Image := "dhlabbasel/salsah1:" + version.value, + + // use these values for variable substitution in the docker-compose.yml + variablesForSubstitution := Map( + "KNORA_GDB_HOME" -> Dependencies.gdbHomePath.value, + "KNORA_GDB_LICENSE" -> Dependencies.gdbLicensePath.value, + "KNORA_GDB_TYPE" -> Dependencies.gdbTypeString, + "KNORA_GDB_IMAGE" -> Dependencies.knoraGdbImage.value, + "KNORA_SIPI_IMAGE" -> Dependencies.knoraSipiImage.value, + "KNORA_WEBAPI_IMAGE" -> Dependencies.knoraWebapiImage.value, + "KNORA_SALSAH1_IMAGE" -> Dependencies.knoraSalsah1Image.value + ), + + dockerImageCreationTask := Seq( + (salsah1 / Docker / publishLocal).value, + (webapi / Docker / publishLocal).value, + (knoraGraphDbSe / Docker / publishLocal).value, + (knoraGraphdbFree / Docker / publishLocal).value, + (knoraSipi / Docker / publishLocal).value + ) + ) ////////////////////////////////////// @@ -194,7 +195,7 @@ lazy val graphdbseCommonSettings = Seq( name := "knora-graphdb-se" ) -lazy val knoraGraphDbSe = knoraModule("knora-graphdb-se") +lazy val knoraGraphDbSe: Project = knoraModule("knora-graphdb-se") .enablePlugins(DockerPlugin) .settings( graphdbseCommonSettings @@ -213,7 +214,7 @@ lazy val knoraGraphDbSe = knoraModule("knora-graphdb-se") dockerRepository := Some("dhlabbasel"), - maintainer := "ivan.subotic@unibas.ch", + maintainer := "400790+subotic@users.noreply.github.com", Docker / dockerExposedPorts ++= Seq(7200), Docker / dockerCommands := Seq( @@ -221,7 +222,7 @@ lazy val knoraGraphDbSe = knoraModule("knora-graphdb-se") Cmd("FROM", "ontotext/graphdb:8.5.0-se"), Cmd("LABEL", s"""MAINTAINER="${maintainer.value}""""), Cmd("COPY", "opt/docker/scripts", "/scripts"), - Cmd("RUN", "mkdir -p /graphdb && cp /scripts/KnoraRules.pie /graphdb/KnoraRules.pie && rm -rf /scripts"), + ExecCmd("RUN", "mkdir -p /graphdb && cp /scripts/KnoraRules.pie /graphdb/KnoraRules.pie && rm -rf /scripts"), ) ) @@ -233,7 +234,7 @@ lazy val graphdbfreeCommonSettings = Seq( name := "knora-graphdb-free" ) -lazy val knoraGraphdbFree = knoraModule("knora-graphdb-free") +lazy val knoraGraphdbFree: Project = knoraModule("knora-graphdb-free") .enablePlugins(DockerPlugin) .settings( graphdbfreeCommonSettings @@ -252,7 +253,7 @@ lazy val knoraGraphdbFree = knoraModule("knora-graphdb-free") dockerRepository := Some("dhlabbasel"), - maintainer := "ivan.subotic@unibas.ch", + maintainer := "400790+subotic@users.noreply.github.com", Docker / dockerExposedPorts ++= Seq(7200), Docker / dockerCommands := Seq( @@ -260,7 +261,7 @@ lazy val knoraGraphdbFree = knoraModule("knora-graphdb-free") Cmd("FROM", "dhlabbasel/graphdb:8.10.0-free"), Cmd("LABEL", s"""MAINTAINER="${maintainer.value}""""), Cmd("COPY", "opt/docker/scripts", "/scripts"), - Cmd("RUN", "mkdir -p /graphdb && cp /scripts/KnoraRules.pie /graphdb/KnoraRules.pie && rm -rf /scripts"), + ExecCmd("RUN", "mkdir -p /graphdb && cp /scripts/KnoraRules.pie /graphdb/KnoraRules.pie && rm -rf /scripts"), ) ) @@ -272,7 +273,7 @@ lazy val knoraSipiCommonSettings = Seq( name := "knora-sipi" ) -lazy val knoraSipi = knoraModule("knora-sipi") +lazy val knoraSipi: Project = knoraModule("knora-sipi") .enablePlugins(DockerPlugin) .settings( knoraSipiCommonSettings @@ -291,7 +292,7 @@ lazy val knoraSipi = knoraModule("knora-sipi") dockerRepository := Some("dhlabbasel"), - maintainer := "ivan.subotic@unibas.ch", + maintainer := "400790+subotic@users.noreply.github.com", Docker / dockerExposedPorts ++= Seq(1024), Docker / dockerCommands := Seq( @@ -311,7 +312,7 @@ lazy val knoraAssetsCommonSettings = Seq( name := "knora-assets" ) -lazy val knoraAssets = knoraModule("knora-assets") +lazy val knoraAssets: Project = knoraModule("knora-assets") .enablePlugins(DockerPlugin) .settings( knoraAssetsCommonSettings @@ -323,9 +324,9 @@ lazy val knoraAssets = knoraModule("knora-assets") Universal / mappings ++= { // copy the different folders directory("webapi/scripts") ++ - directory("webapi/_test_data") ++ - directory("webapi/_assets") ++ - directory("knora-ontologies") + directory("webapi/_test_data") ++ + directory("webapi/_assets") ++ + directory("knora-ontologies") }, // add dockerCommands used to create the image @@ -333,7 +334,7 @@ lazy val knoraAssets = knoraModule("knora-assets") dockerRepository := Some("dhlabbasel"), - maintainer := "ivan.subotic@unibas.ch", + maintainer := "400790+subotic@users.noreply.github.com", Docker / dockerExposedPorts ++= Seq(9999), // not used. added just so that there is no warning Docker / dockerCommands := Seq( Cmd("FROM", "scratch"), @@ -346,41 +347,91 @@ lazy val knoraAssets = knoraModule("knora-assets") // Knora upgrade scripts ////////////////////////////////////// -lazy val knoraUpgradeCommonSettings = Seq( - name := "knora-upgrade" +lazy val upgradeCommonSettings = Seq( + name := "upgrade" ) -lazy val knoraUpgrade = knoraModule("knora-upgrade") - .enablePlugins(DockerPlugin) +lazy val upgrade: Project = knoraModule("upgrade") + .dependsOn(webapi) + .enablePlugins(JavaAppPackaging, DockerPlugin) .settings( - knoraUpgradeCommonSettings + upgradeCommonSettings, + Dependencies.upgradeLibraryDependencies, + // use jars (and not class directory) for run, test, console + exportJars := true, + unmanagedResourceDirectories in Compile += (rootBaseDir.value / "knora-ontologies"), + + // add content of knora-ontologies to jar + mappings in (Compile, packageBin) ++= Seq ( + (rootBaseDir.value / "knora-ontologies" / "knora-admin.ttl") -> "knora-ontologies/knora-admin.ttl", + (rootBaseDir.value / "knora-ontologies" / "knora-base.ttl") -> "knora-ontologies/knora-base.ttl", + (rootBaseDir.value / "knora-ontologies" / "salsah-gui.ttl") -> "knora-ontologies/salsah-gui.ttl", + (rootBaseDir.value / "knora-ontologies" / "standoff-data.ttl") -> "knora-ontologies/standoff-data.ttl", + (rootBaseDir.value / "knora-ontologies" / "standoff-onto.ttl") -> "knora-ontologies/standoff-onto.ttl", + ), + // contentOf("salsah1/src/main/resources").toMap.mapValues("config/" + _) + // (rootBaseDir.value / "knora-ontologies") -> "knora-ontologies", + + ) + .settings( + scalacOptions ++= Seq("-feature", "-unchecked", "-deprecation", "-Yresolve-term-conflict:package"), + logLevel := Level.Info, + run / fork := true, + run / javaOptions ++= upgradeJavaRunOptions, + Compile / run / mainClass := Some("org.knora.upgrade.Main"), + Test / fork := true, + Test / javaOptions ++= upgradeJavaTestOptions, + Test / parallelExecution := false, + /* show full stack traces and test case durations */ + Test / testOptions += Tests.Argument("-oDF"), ) .settings( // Skip packageDoc and packageSrc task on stage Compile / packageDoc / mappings := Seq(), Compile / packageSrc / mappings := Seq(), + Universal / mappings ++= { // copy the different folders - directory("upgrade") + directory("upgrade/graphdb-se") }, // add dockerCommands used to create the image // docker:stage, docker:publishLocal, docker:publish, docker:clean - dockerRepository := Some("dhlabbasel"), - - maintainer := "ivan.subotic@unibas.ch", - Docker / dockerExposedPorts ++= Seq(9999), // not used. added just so that there is no warning + dockerUpdateLatest := true, + maintainer := "400790+subotic@users.noreply.github.com", Docker / dockerCommands := Seq( - Cmd("FROM", "python:3.7-stretch"), + Cmd("FROM", "adoptopenjdk/openjdk11:alpine-jre"), Cmd("LABEL", s"""MAINTAINER="${maintainer.value}""""), - Cmd("COPY", "opt/docker", "/"), - Cmd("RUN", "pip install -r /upgrade/requirements.txt"), - Cmd("ENTRYPOINT", "/upgrade/update-repository.py"), - Cmd("CMD", "-h") - ) + Cmd("RUN apk update && apk upgrade && apk add bash"), + + Cmd("ENV", """KNORA_UPGRADE_DOCKER="true""""), + Cmd("COPY", "opt/docker", "/upgrade"), + Cmd("WORKDIR", "/upgrade/graphdb-se"), + ExecCmd("ENTRYPOINT", "/upgrade/graphdb-se/auto-upgrade.sh"), + ), ) +lazy val upgradeJavaRunOptions = Seq( + // "-showversion", + "-Xms1G", + "-Xmx1G" + // "-verbose:gc", + //"-XX:+UseG1GC", + //"-XX:MaxGCPauseMillis=500", + //"-XX:MaxMetaspaceSize=4096m" +) + +lazy val upgradeJavaTestOptions = Seq( + // "-showversion", + "-Xms1G", + "-Xmx1G" + // "-verbose:gc", + //"-XX:+UseG1GC", + //"-XX:MaxGCPauseMillis=500", + //"-XX:MaxMetaspaceSize=4096m" +) + ////////////////////////////////////// // SALSAH1 (./salsah1) ////////////////////////////////////// @@ -389,80 +440,78 @@ lazy val salsahCommonSettings = Seq( name := "salsah1" ) -lazy val salsah1 = knoraModule("salsah1") - .enablePlugins(JavaAppPackaging, DockerPlugin, DockerComposePlugin) - .configs( - HeadlessTest - ) - .settings( - salsahCommonSettings, - Revolver.settings - ) - .settings(inConfig(HeadlessTest)( - Defaults.testTasks ++ Seq( - fork := true, - javaOptions ++= javaHeadlessTestOptions, - testOptions += Tests.Argument("-oDF") // show full stack traces and test case durations - ) - ): _*) - .settings( - Dependencies.salsahLibraryDependencies, - logLevel := Level.Info, - run / fork := true, - run / javaOptions ++= javaRunOptions, - Compile / run / mainClass := Some("org.knora.salsah.Main"), - Test / fork := true, - Test / javaOptions ++= javaTestOptions, - Test / parallelExecution := false, - /* show full stack traces and test case durations */ - Test / testOptions += Tests.Argument("-oDF") - ) - .settings( // enable deployment staging with `sbt stage` - // Skip packageDoc and packageSrc task on stage - Compile / packageDoc / mappings := Seq(), - Compile / packageSrc / mappings := Seq(), - Universal / mappings ++= { - // copy the public folder - directory("salsah1/src/public") ++ - // copy the configuration files to config directory - // contentOf("salsah1/configs").toMap.mapValues("config/" + _) ++ - // copy configuration files to config directory - contentOf("salsah1/src/main/resources").toMap.mapValues("config/" + _) - }, - // add 'config' directory first in the classpath of the start script, - scriptClasspath := Seq("../config/") ++ scriptClasspath.value, - // need this here, but why? - Compile / mainClass := Some("org.knora.salsah.Main"), - - // add dockerCommands used to create the image - // docker:stage, docker:publishLocal, docker:publish, docker:clean - - dockerRepository := Some("dhlabbasel"), +lazy val salsah1: Project = knoraModule("salsah1") + .enablePlugins(JavaAppPackaging, DockerPlugin, DockerComposePlugin) + .configs( + HeadlessTest + ) + .settings( + salsahCommonSettings, + Revolver.settings + ) + .settings(inConfig(HeadlessTest)( + Defaults.testTasks ++ Seq( + fork := true, + javaOptions ++= javaHeadlessTestOptions, + testOptions += Tests.Argument("-oDF") // show full stack traces and test case durations + ) + ): _*) + .settings( + Dependencies.salsahLibraryDependencies, + logLevel := Level.Info, + run / fork := true, + run / javaOptions ++= javaRunOptions, + Compile / run / mainClass := Some("org.knora.salsah.Main"), + Test / fork := true, + Test / javaOptions ++= javaTestOptions, + Test / parallelExecution := false, + /* show full stack traces and test case durations */ + Test / testOptions += Tests.Argument("-oDF") + ) + .settings( // enable deployment staging with `sbt stage` + // Skip packageDoc and packageSrc task on stage + Compile / packageDoc / mappings := Seq(), + Compile / packageSrc / mappings := Seq(), + Universal / mappings ++= { + // copy the public folder + directory("salsah1/src/public") ++ + // copy the configuration files to config directory + // contentOf("salsah1/configs").toMap.mapValues("config/" + _) ++ + // copy configuration files to config directory + contentOf("salsah1/src/main/resources").toMap.mapValues("config/" + _) + }, + // add 'config' directory first in the classpath of the start script, + scriptClasspath := Seq("../config/") ++ scriptClasspath.value, + // need this here, but why? + Compile / mainClass := Some("org.knora.salsah.Main"), - maintainer := "ivan.subotic@unibas.ch", + // add dockerCommands used to create the image + // docker:stage, docker:publishLocal, docker:publish, docker:clean - Docker / dockerExposedPorts ++= Seq(3335), - Docker / dockerCommands := Seq( - Cmd("FROM", "adoptopenjdk/openjdk11:alpine-jre"), - Cmd("LABEL", s"""MAINTAINER="${maintainer.value}""""), + dockerRepository := Some("dhlabbasel"), - Cmd("ENV", """LANG="en_US.UTF-8""""), - Cmd("ENV", """JAVA_OPTS="-Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8""""), - Cmd("ENV", "KNORA_SALSAH1_DEPLOYED=true"), - Cmd("ENV", "KNORA_SALSAH1_WORKDIR=/salsah1"), + maintainer := "400790+subotic@users.noreply.github.com", - Cmd("RUN apk update && apk upgrade && apk add bash"), + Docker / dockerExposedPorts ++= Seq(3335), + Docker / dockerCommands := Seq( + Cmd("FROM", "adoptopenjdk/openjdk11:alpine-jre"), + Cmd("LABEL", s"""MAINTAINER="${maintainer.value}""""), - Cmd("COPY", "opt/docker", "/salsah1"), - Cmd("WORKDIR", "/salsah1"), + Cmd("ENV", """LANG="en_US.UTF-8""""), + Cmd("ENV", """JAVA_OPTS="-Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8""""), + Cmd("ENV", "KNORA_SALSAH1_DEPLOYED=true"), + Cmd("ENV", "KNORA_SALSAH1_WORKDIR=/salsah1"), + Cmd("RUN apk update && apk upgrade && apk add bash"), + Cmd("COPY", "opt/docker", "/salsah1"), + Cmd("WORKDIR", "/salsah1"), - Cmd("EXPOSE", "3335"), + Cmd("EXPOSE", "3335"), - ExecCmd("ENTRYPOINT", "bin/salsah1"), - ), + ExecCmd("ENTRYPOINT", "bin/salsah1"), + ), - ) + ) lazy val javaRunOptions = Seq( // "-showversion", @@ -630,7 +679,7 @@ lazy val webapi = knoraModule("webapi") dockerRepository := Some("dhlabbasel"), - maintainer := "ivan.subotic@unibas.ch", + maintainer := "400790+subotic@users.noreply.github.com", Docker / dockerExposedPorts ++= Seq(3333, 10001), Docker / dockerCommands := Seq( @@ -746,4 +795,4 @@ lazy val webapi_it = project def knoraModule(name: String): Project = Project(id = name, base = file(name)) - .settings(buildSettings) + .settings(buildSettings) diff --git a/Makefile b/Makefile index 0badd39a92..6827a46a9b 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ docs-build: ## build the docs .PHONY: build-all-scala build-all-scala: ## build all scala projects - sbt webapi/universal:stage knora-graphdb-se/universal:stage knora-graphdb-free/universal:stage knora-sipi/universal:stage salsah1/universal:stage knora-upgrade/universal:stage knora-assets/universal:stage webapi_test/universal:stage webapi_it/universal:stage + sbt webapi/universal:stage knora-graphdb-se/universal:stage knora-graphdb-free/universal:stage knora-sipi/universal:stage salsah1/universal:stage upgrade/universal:stage knora-assets/universal:stage webapi_test/universal:stage webapi_it/universal:stage ## knora-api .PHONY: build-knora-api-image @@ -38,7 +38,7 @@ publish-knora-api-image: build-knora-api-image ## publish knora-api image to Doc build-knora-graphdb-se-image: build-all-scala ## build and publish knora-graphdb-se docker image locally @mkdir -p .docker @sed -e "s/@GRAPHDB_IMAGE@/ontotext\/graphdb\:$(GRAPHDB_SE_VERSION)-se/" docker/knora-graphdb.template.dockerfile > .docker/knora-graphdb-se.dockerfile - docker build -t $(KNORA_GRAPHDB_SE_IMAGE) -f .docker/knora-graphdb-se.dockerfile knora-graphdb-se/target/universal + docker build -t $(KNORA_GRAPHDB_SE_IMAGE) -t $(REPO_PREFIX)/$(KNORA_GRAPHDB_SE_REPO):latest -f .docker/knora-graphdb-se.dockerfile knora-graphdb-se/target/universal .PHONY: publish-knora-graphdb-se-image publish-knora-graphdb-se-image: build-knora-graphdb-se-image ## publish knora-graphdb-se image to Dockerhub @@ -73,12 +73,12 @@ build-knora-salsah1-image: build-all-scala ## build and publish knora-salsah1 do .PHONY: publish-knora-salsah1-image publish-knora-salsah1-image: build-knora-salsah1-image ## publish knora-salsah1 image to Dockerhub - docker push $(KNORA_SALSAH_IMAGE) + docker push $(KNORA_SALSAH1_IMAGE) ## knora-upgrade .PHONY: build-knora-upgrade-image build-knora-upgrade-image: build-all-scala ## build and publish knora-upgrade docker image locally - docker build -t $(KNORA_UPGRADE_IMAGE) -f docker/knora-upgrade.dockerfile knora-upgrade/target/universal + docker build -t $(KNORA_UPGRADE_IMAGE) -t $(REPO_PREFIX)/$(KNORA_UPGRADE_REPO):latest -f docker/knora-upgrade.dockerfile upgrade/target/universal .PHONY: publish-knora-upgrade publish-knora-upgrade: build-knora-upgrade-image ## publish knora-upgrade image to Dockerhub diff --git a/docker/knora-upgrade.dockerfile b/docker/knora-upgrade.dockerfile index 4bed3aa2a0..7f93cb8850 100644 --- a/docker/knora-upgrade.dockerfile +++ b/docker/knora-upgrade.dockerfile @@ -1,8 +1,11 @@ -FROM python:3.7-stretch +FROM adoptopenjdk/openjdk11:alpine-jre -COPY stage/upgrade /upgrade -RUN pip install -r /upgrade/requirements.txt -ENTRYPOINT /upgrade/update-repository.py -CMD -h +RUN apk update && apk upgrade && apk add bash curl + +COPY stage /upgrade + +WORKDIR /upgrade/graphdb-se + +ENTRYPOINT ["/upgrade/graphdb-se/auto-upgrade.sh"] LABEL MAINTAINER="400790+subotic@users.noreply.github.com" diff --git a/docs/src/paradox/04-publishing-deployment/updates.md b/docs/src/paradox/04-publishing-deployment/updates.md index d31796e28e..7bd5a0486e 100644 --- a/docs/src/paradox/04-publishing-deployment/updates.md +++ b/docs/src/paradox/04-publishing-deployment/updates.md @@ -19,22 +19,87 @@ License along with Knora. If not, see . # Updating Repositories When Upgrading Knora +@@toc + When a new version of Knora introduces changes that are not backwards-compatible -with existing data, you will need to update your repository. Follow the -instructions below for the Knora version that you are upgrading from. +with existing data, you will need to update your repository. First, back up +your repository. Then follow the instructions below for the Knora version that +you are upgrading from. ## Upgrading from Knora 7.0.0 or Later -Follow the instructions in `upgrade/README.md`. +### Automatic Upgrade + +The automatic upgrade procedure dumps your repository to a file, determines which transformations +are needed, transforms the file, then loads the transformed file back into the repository. +To perform an automatic upgrade, open a shell in the directory `upgrade/graphdb-se` and run the script +`./auto-upgrade.sh`. You must be in that directory when you run the script. For information on its +command line options, run it without arguments, or see the `README.md` in that directory for details. + +### Manual Upgrade + +If you need more control over the process (e.g. you want to use +GraphDB's [LoadRDF](http://graphdb.ontotext.com/documentation/free/loading-data-using-the-loadrdf-tool.html) +tool to upload the transformed file), follow the steps below. + +#### 1. Dump the Repository to a TriG File + +You can use the `dump-repository.sh` script in `upgrade/graphdb-se`. See +the `README.md` there for instructions. + +#### 2. Transform the TriG File + +In the `knora-api` directory of the version of Knora you are upgrading to, run: + +``` +sbt "upgrade/run INPUT_FILE OUTPUT_FILE" +``` + +For `INPUT_FILE`, use the absolute path of the TriG file you downloaded in +step 1. + +For `OUTPUT_FILE`, use the absolute path of the transformed TriG file to +be created. + +The program automatically determines which transformations are needed. +If the repository is already up to date, the program will say so, and no +output file will be written. In this case, there is nothing more to do. +Otherwise, proceed to step 3. + +#### 3. Empty the Repository + +The transformed TriG file must be loaded into an empty repository. +To empty the repository, you can use the `empty-repository.sh` script in +`upgrade/graphdb-se`. See the `README.md` there for instructions. +Make sure you have backed up the repository first. + +#### 4. Load the Transformed TriG File into the Repository + +You can use the `upload-repository.sh` script in `upgrade/graphdb-se`. See +the `README.md` there for instructions. + +If the file is very large, it may be more efficient to load it offline, +using GraphDB's [LoadRDF](http://graphdb.ontotext.com/documentation/free/loading-data-using-the-loadrdf-tool.html) +tool. + +## Upgrading from a Knora Version Before 7.0.0 + +First, read the general instructions in `upgrade/graphdb-se/old/README.md`. + +### Upgrading from Knora 6.0.0 or 6.0.1 + +1. Follow the instructions in `upgrade/graphdb-se/old/1263-knora-admin/README.md`. + +2. Follow the instructions in + @ref:[Upgrading from Knora 7.0.0 or Later](#upgrading-from-knora-7-0-0-or-later). + +### Upgrading from Knora 5.0.0 -## Upgrading from Knora 6.0.0 or 6.0.1 +1. Follow the instructions in `upgrade/graphdb-se/old/1211-datetime/README.md`. -1. Follow the instructions in `upgrade/old/1263-knora-admin/README.md`. -2. Follow the instructions in `upgrade/README.md`. +2. Follow the instructions in `upgrade/graphdb-se/old/1230-delete-previews/README.md`. -## Upgrading from Knora 5.0.0 +3. Follow the instructions in `upgrade/graphdb-se/old/1263-knora-admin/README.md`. -1. Follow the instructions in `upgrade/old/1211-datetime/README.md`. -2. Follow the instructions in `upgrade/old/1230-delete-previews/README.md`. -3. Follow the instructions in `upgrade/old/1263-knora-admin/README.md`. -4. Follow the instructions in `upgrade/README.md`. +4. Follow the instructions in + @ref:[Upgrading from Knora 7.0.0 or Later](#upgrading-from-knora-7-0-0-or-later). diff --git a/docs/src/paradox/05-internals/development/updating-repositories.md b/docs/src/paradox/05-internals/development/updating-repositories.md index fdd8e3a27f..aa3d04f73d 100644 --- a/docs/src/paradox/05-internals/development/updating-repositories.md +++ b/docs/src/paradox/05-internals/development/updating-repositories.md @@ -24,62 +24,55 @@ As explained in the `knora-base` ontology contains a version string to ensure compatibility between a repository and a given version of Knora. The same version string is therefore hard-coded in the Knora source code, in the string constant -`org.knora.webapi.KnoraBaseVersion`. The format of this string is currently -`PR NNNN`, where `NNNN` is the number of a GitHub pull request. Each time -a pull request introduces changes that are not compatible with existing data, -the following must happen: - -- The `knora-base` version string must be updated in `knora-base.ttl` and - in the string constant `org.knora.webapi.KnoraBaseVersion`. This version - string must contain the number of the last pull request that introduced - a breaking change. - -- A plugin must be added to the - @ref:[repository update program](../../04-publishing-deployment/updates.md), to update - existing repositories to work with the new version of Knora. The plugin will - be used by `update-repository.py` if needed. +`org.knora.webapi.KnoraBaseVersion`. For new pull requests, the format of this string +is `knora-base vN`, where `N` is an integer that is incremented for +each version. Each time a pull request introduces changes that are not compatible +with existing data, the following must happen: -## Adding an Update Plugin +- The `knora-base` version number must be incremented in `knora-base.ttl` and + in the string constant `org.knora.webapi.KnoraBaseVersion`. + +- A plugin must be added in the `upgrade` subproject under `org.knora.upgrade.plugins`, + and registered in `org.knora.upgrade.Main`, to transform + existing repositories so that they are compatible with the code changes + introduced in the pull request. -An update plugin is a Python module, which must be put in a subdirectory -of `upgrade/plugins`. The name of the plugin's directory must be `prNNNN`, where -`NNNN` is the pull request number. That directory must have a subdirectory called -`knora-ontologies`, containing the following built-in Knora ontologies with any -modifications introduced by that pull request: +## Adding an Upgrade Plugin -- `knora-admin.ttl` -- `knora-base.ttl` -- `salsah-gui.ttl` -- `standoff-onto.ttl` +An upgrade plugin is a Scala class that extends `UpgradePlugin`. The name of the plugin +class should refer to the pull request that made the transformation necessary, +using the format `UpgradePluginPRNNNN`, where `NNNN` is the number of the pull request. -The `knora-base.ttl` file must contain a `knora-base:ontologyVersion` that -matches the pull request number. +A plugin's `transform` method takes an RDF4J `Model` (a mutable object representing +the repository) and modifies it as needed. For details on how to do this, see +[The RDF Model API](https://rdf4j.eclipse.org/documentation/programming/model/) +in the RDF4J documentation. -Each plugin module must be in a file called `update.py`, and must contain -a class called `GraphTransformer`, defined like this: +The plugin must then be added to the collection `pluginsForVersions` in +`org.knora.upgrade.Main`. -```python -import rdflib -from updatelib import rdftools +## Testing Update Plugins -class GraphTransformer(rdftools.GraphTransformer): - def transform(self, graph): - # Do the transformation -``` +Each plugin should have a unit test that extends `UpgradePluginSpec`. A typical +test loads a TriG file containing test data into a `Model`, runs the plugin, +makes an RDF4J `SailRepository` containing the transformed `Model`, and uses +SPARQL to check the result. -The `transform` method takes an `rdflib.graph.Graph` and returns a transformed -graph (which may be the same graph instance or a new one). See the -[rdflib documentation](https://rdflib.readthedocs.io/en/stable/index.html) -for details of that class. +## Design Rationale -This method will be called once for each named graph downloaded from the -triplestore. +We tried and rejected other designs: -The `updatelib.rdftools` library provides convenience functions for working -with RDF data. +- Running SPARQL updates in the triplestore: too slow, and no way to report + progress during the update. + +- Downloading the repository and transforming it in Python using + [rdflib](https://rdflib.readthedocs.io/en/stable/): too slow. + +- Downloading the repository and transforming it in C++ using + [Redland](http://librdf.org): also too slow. -## Testing Update Plugins +The Scala implementation is the fastest by far. -Each plugin should have a unit test that can be run by -[pytest](https://docs.pytest.org/en/latest/index.html). To run all the -plugin unit tests, run the script `./test.sh` in the `upgrade` directory. +The whole repository is uploaded in a single transaction because +GraphDB's consistency checker can enforce dependencies between named +graphs. diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 468f3f02f5..a61ae398bd 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -209,6 +209,7 @@ object Dependencies { akkaStream.value, WebapiTest.akkaStreamTestkit.value, WebapiTest.akkaTestkit.value, + apacheHttpClient, bcprov, chill, commonsBeanUtil, @@ -220,6 +221,7 @@ object Dependencies { WebapiTest.gatlingHighcharts, WebapiTest.gatlingTestFramework, gwtServlet, + icu4j, jacksonScala, jaxbApi, jsonldJava, @@ -246,9 +248,13 @@ object Dependencies { springSecurityCore, swaggerAkkaHttp, typesafeConfig, - xmlunitCore, - icu4j, - apacheHttpClient + xmlunitCore + ) + + val upgradeLibraryDependencies = l ++= Seq[sbt.ModuleID]( + rdf4jRuntime, + SalsahTest.scalaTest, + scallop ) val webapiTestAndITLibraryDependencies = l ++= Seq[sbt.ModuleID]( diff --git a/upgrade/graphdb-se/.gitignore b/upgrade/graphdb-se/.gitignore new file mode 100644 index 0000000000..2fe000267b --- /dev/null +++ b/upgrade/graphdb-se/.gitignore @@ -0,0 +1 @@ +*.trig diff --git a/upgrade/graphdb-se/README.md b/upgrade/graphdb-se/README.md new file mode 100644 index 0000000000..400f86cb4a --- /dev/null +++ b/upgrade/graphdb-se/README.md @@ -0,0 +1,73 @@ +# Scripts for Upgrading GraphDB Repositories + +This directory contains shell scripts for updating a GraphDB repository +to work with a new version of Knora. + +You will need to have [curl](https://curl.haxx.se) installed. + +## Automatic Upgrade + +This dumps your repository to a file, determines which transformations are needed, +transforms the file, then loads the transformed file back into the repository. +Make sure you have backed up the repository before you do this. + +``` +./auto-upgrade.sh -r|--repository REPOSITORY -u|--username USERNAME [-p|--password PASSWORD] [-h|--host HOST] +``` + +- `-r`: the name of the repository. +- `-u`: the GraphDB username. +- `-p`: the GraphDB password. If not supplied, you will be prompted for it. +- `-h`: the GraphDB host and port. Defaults to `localhost:7200`. + +If the environment variable `KNORA_UPGRADE_DOCKER` is set, this script runs the +upgrade program using the executable `/upgrade/bin/upgrade`. Otherwise, it runs +the program using SBT. + +## Scripts for Manual Upgrades + +These scripts are useful if you want more control over the upgrade process. + +### Dumping a GraphDB Repository to a TriG File + +``` +./dump-repository.sh -r|--repository REPOSITORY -u|--username USERNAME [-p|--password PASSWORD] [-h|--host HOST] FILE +``` + +- `-r`: the name of the repository. +- `-u`: the GraphDB username. +- `-p`: the GraphDB password. If not supplied, you will be prompted for it. +- `-h`: the GraphDB host and port. Defaults to `localhost:7200`. +- `FILE`: the file path of the TriG file to be written. + +### Emptying a GraphDB Repository + +This empties a GraphDB repository by running a SPARQL `DROP ALL` command. Make sure you +have backed up the repository before you do this. + +``` +./empty-repository.sh -r|--repository REPOSITORY -u|--username USERNAME [-p|--password PASSWORD] [-h|--host HOST] +``` + +- `-r`: the name of the repository. +- `-u`: the GraphDB username. +- `-p`: the GraphDB password. If not supplied, you will be prompted for it. +- `-h`: the GraphDB host and port. Defaults to `localhost:7200`. + +### Uploading a TriG File to a GraphDB Repository + +This uploads the TriG file to GraphDB over HTTP. + +``` +./upload-repository.sh -r|--repository REPOSITORY -u|--username USERNAME [-p|--password PASSWORD] [-h|--host HOST] FILE +``` + +- `-r`: the name of the repository. +- `-u`: the GraphDB username. +- `-p`: the GraphDB password. If not supplied, you will be prompted for it. +- `-h`: the GraphDB host and port. Defaults to `localhost:7200`. +- `FILE`: the file path of the TriG file to be uploaded. + +If the file is very large, it may be more efficient to load it offline, +using GraphDB's [LoadRDF](http://graphdb.ontotext.com/documentation/free/loading-data-using-the-loadrdf-tool.html) +tool. diff --git a/upgrade/graphdb-se/auto-upgrade.sh b/upgrade/graphdb-se/auto-upgrade.sh new file mode 100755 index 0000000000..7379170dc3 --- /dev/null +++ b/upgrade/graphdb-se/auto-upgrade.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash + +#set -x +set -e + +POSITIONAL=() +while [[ $# -gt 0 ]] +do +key="$1" + +case $key in + -r|--repository) + REPOSITORY="$2" + shift # past argument + shift # past value + ;; + -u|--username) + USERNAME="$2" + shift # past argument + shift # past value + ;; + -p|--password) + PASSWORD="$2" + shift # past argument + shift # past value + ;; + -h|--host) + HOST="$2" + shift # past argument + shift # past value + ;; + -t|--tempdir) + TEMP_DIR="$2" + shift # past argument + shift # past value + ;; + *) # unknown option + POSITIONAL+=("$1") # save it in an array for later + shift # past argument + ;; +esac +done +set -- "${POSITIONAL[@]}" # restore positional parameters + +if [[ -z "${REPOSITORY}" || -z "${USERNAME}" ]]; then + echo "Usage: $(basename "$0") -r|--repository REPOSITORY -u|--username USERNAME [-p|--password PASSWORD] [-h|--host HOST] [-t|--tempdir temporary directory]" + exit 1 +fi + +if [[ -z "${PASSWORD}" ]]; then + echo -n "Password: " + IFS="" read -rs PASSWORD + echo +fi + +if [[ -z "${HOST}" ]]; then + HOST="localhost:7200" +fi + +if [[ -z "${TEMP_DIR}" ]]; then + TEMP_DIR=$(mktemp -d) +else + mkdir -p "${TEMP_DIR}" +fi + +INPUT_FILE=${TEMP_DIR}/dump.trig +OUTPUT_FILE=${TEMP_DIR}/transformed.trig + +# Download the repository. +echo "Downloading repository..." +curl -X GET -H "Accept: application/trig" -u "${USERNAME}:${PASSWORD}" "http://${HOST}/repositories/${REPOSITORY}/statements?infer=false" > "${INPUT_FILE}" + +# Transform the downloaded file. +echo "Checking for needed transformations..." + +if [[ -z "${KNORA_UPGRADE_DOCKER}" ]]; then + # Run the upgrade program using SBT. + (cd ../.. && sbt "upgrade/run ${INPUT_FILE} ${OUTPUT_FILE}") +else + # Run the upgrade program using Docker. + /upgrade/bin/upgrade "${INPUT_FILE}" "${OUTPUT_FILE}" +fi + +# If a transformed file was produced, empty the repository and upload the transformed file. +if [[ -f "${OUTPUT_FILE}" ]]; then + echo "Emptying repository..." + curl -X POST -H "Content-Type: application/sparql-update" -d "DROP ALL" -u "${USERNAME}:${PASSWORD}" "http://${HOST}/repositories/${REPOSITORY}/statements" + + echo "Uploading transformed data to repository..." + curl -X POST -H "Content-Type: application/trig" -d "@${OUTPUT_FILE}" -u "${USERNAME}:${PASSWORD}" "http://${HOST}/repositories/${REPOSITORY}/statements" | tee /dev/null +fi + +rm -r "${TEMP_DIR}" +echo "Done." diff --git a/upgrade/graphdb-se/dump-repository.sh b/upgrade/graphdb-se/dump-repository.sh new file mode 100755 index 0000000000..d7ab11a534 --- /dev/null +++ b/upgrade/graphdb-se/dump-repository.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +#set -x + +POSITIONAL=() +while [[ $# -gt 0 ]] +do +key="$1" + +case $key in + -r|--repository) + REPOSITORY="$2" + shift # past argument + shift # past value + ;; + -u|--username) + USERNAME="$2" + shift # past argument + shift # past value + ;; + -p|--password) + PASSWORD="$2" + shift # past argument + shift # past value + ;; + -h|--host) + HOST="$2" + shift # past argument + shift # past value + ;; + *) # unknown option + POSITIONAL+=("$1") # save it in an array for later + shift # past argument + ;; +esac +done +set -- "${POSITIONAL[@]}" # restore positional parameters + +FILE="$1" + +if [[ -z "${REPOSITORY}" || -z "${USERNAME}" || -z "${FILE}" ]]; then + echo "Usage: $(basename "$0") -r|--repository REPOSITORY -u|--username USERNAME [-p|--password PASSWORD] [-h|--host HOST] FILE" + exit 1 +fi + +if [[ -z "${PASSWORD}" ]]; then + echo -n "Password: " + IFS="" read -rs PASSWORD + echo +fi + +if [[ -z "${HOST}" ]]; then + HOST="localhost:7200" +fi + +curl -X GET -H "Accept: application/trig" -u "${USERNAME}:${PASSWORD}" "http://${HOST}/repositories/${REPOSITORY}/statements?infer=false" > "${FILE}" diff --git a/upgrade/graphdb-se/empty-repository.sh b/upgrade/graphdb-se/empty-repository.sh new file mode 100755 index 0000000000..4faa14925d --- /dev/null +++ b/upgrade/graphdb-se/empty-repository.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash + +#set -x + +POSITIONAL=() +while [[ $# -gt 0 ]] +do +key="$1" + +case $key in + -r|--repository) + REPOSITORY="$2" + shift # past argument + shift # past value + ;; + -u|--username) + USERNAME="$2" + shift # past argument + shift # past value + ;; + -p|--password) + PASSWORD="$2" + shift # past argument + shift # past value + ;; + -h|--host) + HOST="$2" + shift # past argument + shift # past value + ;; + *) # unknown option + POSITIONAL+=("$1") # save it in an array for later + shift # past argument + ;; +esac +done +set -- "${POSITIONAL[@]}" # restore positional parameters + +if [[ -z "${REPOSITORY}" || -z "${USERNAME}" ]]; then + echo "Usage: $(basename "$0") -r|--repository REPOSITORY -u|--username USERNAME [-p|--password PASSWORD] [-h|--host HOST]" + exit 1 +fi + +if [[ -z "${PASSWORD}" ]]; then + echo -n "Password: " + IFS="" read -rs PASSWORD + echo +fi + +if [[ -z "${HOST}" ]]; then + HOST="localhost:7200" +fi + +curl -X POST -H "Content-Type: application/sparql-update" -d "DROP ALL" -u "${USERNAME}:${PASSWORD}" "http://${HOST}/repositories/${REPOSITORY}/statements" diff --git a/upgrade/.gitignore b/upgrade/graphdb-se/old/.gitignore similarity index 100% rename from upgrade/.gitignore rename to upgrade/graphdb-se/old/.gitignore diff --git a/upgrade/old/1211-datetime/README.md b/upgrade/graphdb-se/old/1211-datetime/README.md similarity index 100% rename from upgrade/old/1211-datetime/README.md rename to upgrade/graphdb-se/old/1211-datetime/README.md diff --git a/upgrade/old/1211-datetime/sparql/update-dates.rq b/upgrade/graphdb-se/old/1211-datetime/sparql/update-dates.rq similarity index 100% rename from upgrade/old/1211-datetime/sparql/update-dates.rq rename to upgrade/graphdb-se/old/1211-datetime/sparql/update-dates.rq diff --git a/upgrade/old/1211-datetime/update-dates.py b/upgrade/graphdb-se/old/1211-datetime/update-dates.py similarity index 100% rename from upgrade/old/1211-datetime/update-dates.py rename to upgrade/graphdb-se/old/1211-datetime/update-dates.py diff --git a/upgrade/old/1230-delete-previews/README.md b/upgrade/graphdb-se/old/1230-delete-previews/README.md similarity index 100% rename from upgrade/old/1230-delete-previews/README.md rename to upgrade/graphdb-se/old/1230-delete-previews/README.md diff --git a/upgrade/old/1230-delete-previews/delete-preview-values.py b/upgrade/graphdb-se/old/1230-delete-previews/delete-preview-values.py similarity index 100% rename from upgrade/old/1230-delete-previews/delete-preview-values.py rename to upgrade/graphdb-se/old/1230-delete-previews/delete-preview-values.py diff --git a/upgrade/old/1230-delete-previews/get-preview-paths.py b/upgrade/graphdb-se/old/1230-delete-previews/get-preview-paths.py similarity index 100% rename from upgrade/old/1230-delete-previews/get-preview-paths.py rename to upgrade/graphdb-se/old/1230-delete-previews/get-preview-paths.py diff --git a/upgrade/old/1230-delete-previews/sparql/delete-preview-values.rq b/upgrade/graphdb-se/old/1230-delete-previews/sparql/delete-preview-values.rq similarity index 100% rename from upgrade/old/1230-delete-previews/sparql/delete-preview-values.rq rename to upgrade/graphdb-se/old/1230-delete-previews/sparql/delete-preview-values.rq diff --git a/upgrade/old/1230-delete-previews/sparql/get-preview-data.rq b/upgrade/graphdb-se/old/1230-delete-previews/sparql/get-preview-data.rq similarity index 100% rename from upgrade/old/1230-delete-previews/sparql/get-preview-data.rq rename to upgrade/graphdb-se/old/1230-delete-previews/sparql/get-preview-data.rq diff --git a/upgrade/old/1263-knora-admin/README.md b/upgrade/graphdb-se/old/1263-knora-admin/README.md similarity index 100% rename from upgrade/old/1263-knora-admin/README.md rename to upgrade/graphdb-se/old/1263-knora-admin/README.md diff --git a/upgrade/old/1263-knora-admin/knora-ontologies/knora-admin.ttl b/upgrade/graphdb-se/old/1263-knora-admin/knora-ontologies/knora-admin.ttl similarity index 100% rename from upgrade/old/1263-knora-admin/knora-ontologies/knora-admin.ttl rename to upgrade/graphdb-se/old/1263-knora-admin/knora-ontologies/knora-admin.ttl diff --git a/upgrade/old/1263-knora-admin/knora-ontologies/knora-base.ttl b/upgrade/graphdb-se/old/1263-knora-admin/knora-ontologies/knora-base.ttl similarity index 100% rename from upgrade/old/1263-knora-admin/knora-ontologies/knora-base.ttl rename to upgrade/graphdb-se/old/1263-knora-admin/knora-ontologies/knora-base.ttl diff --git a/upgrade/old/1263-knora-admin/update-knora-admin.py b/upgrade/graphdb-se/old/1263-knora-admin/update-knora-admin.py similarity index 100% rename from upgrade/old/1263-knora-admin/update-knora-admin.py rename to upgrade/graphdb-se/old/1263-knora-admin/update-knora-admin.py diff --git a/upgrade/README.md b/upgrade/graphdb-se/old/README.md similarity index 55% rename from upgrade/README.md rename to upgrade/graphdb-se/old/README.md index bbfa8ef17b..0ae0fe826f 100644 --- a/upgrade/README.md +++ b/upgrade/graphdb-se/old/README.md @@ -1,9 +1,8 @@ -# Updating Repositories When Upgrading Knora +# Upgrading from a Knora Version Before 7.0.0 -The command-line program `update-repository.py`, located in this directory, -updates a Knora repository when a Knora upgrade introduces changes that are not -backwards-compatible with existing data. The program checks your repository -and applies any necessary changes. +If you are upgrading from a version of Knora before 7.0.0, you will need +the scripts in `old`. See "Updating Repositories When Upgrading Knora" +in the Knora documentation for details on which scripts to run. ## Prerequisites @@ -26,8 +25,8 @@ scripts: ### Updating Repositories -Run `./update-repository.py` in this directory. You will need to provide some -command-line options; type `./update-repository.py --help` for instructions. +Follow the the instructions in the `README` in the subdirectory containing +each script you need to run. ### After Updating Repositories diff --git a/upgrade/requirements.txt b/upgrade/graphdb-se/old/requirements.txt similarity index 100% rename from upgrade/requirements.txt rename to upgrade/graphdb-se/old/requirements.txt diff --git a/upgrade/graphdb-se/upload-repository.sh b/upgrade/graphdb-se/upload-repository.sh new file mode 100755 index 0000000000..8b8ffe062b --- /dev/null +++ b/upgrade/graphdb-se/upload-repository.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +#set -x + +POSITIONAL=() +while [[ $# -gt 0 ]] +do +key="$1" + +case $key in + -r|--repository) + REPOSITORY="$2" + shift # past argument + shift # past value + ;; + -u|--username) + USERNAME="$2" + shift # past argument + shift # past value + ;; + -p|--password) + PASSWORD="$2" + shift # past argument + shift # past value + ;; + -h|--host) + HOST="$2" + shift # past argument + shift # past value + ;; + *) # unknown option + POSITIONAL+=("$1") # save it in an array for later + shift # past argument + ;; +esac +done +set -- "${POSITIONAL[@]}" # restore positional parameters + +FILE="$1" + +if [[ -z "${REPOSITORY}" || -z "${USERNAME}" || -z "${FILE}" ]]; then + echo "Usage: $(basename "$0") -r|--repository REPOSITORY -u|--username USERNAME [-p|--password PASSWORD] [-h|--host HOST] FILE" + exit 1 +fi + +if [[ -z "${PASSWORD}" ]]; then + echo -n "Password: " + IFS="" read -rs PASSWORD + echo +fi + +if [[ -z "${HOST}" ]]; then + HOST="localhost:7200" +fi + +curl -X POST -H "Content-Type: application/trig" -d "@${FILE}" -u "${USERNAME}:${PASSWORD}" "http://${HOST}/repositories/${REPOSITORY}/statements" | tee /dev/null diff --git a/upgrade/plugins/pr1307/knora-ontologies/knora-admin.ttl b/upgrade/plugins/pr1307/knora-ontologies/knora-admin.ttl deleted file mode 100644 index 68df980d37..0000000000 --- a/upgrade/plugins/pr1307/knora-ontologies/knora-admin.ttl +++ /dev/null @@ -1,773 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix knora-base: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xml: . -@prefix xsd: . -@prefix foaf: . -@prefix dcterms: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The Knora admin ontology"@en ; - - knora-base:attachedToProject :SystemProject . - - -################################################################# -# -# Object Properties -# -################################################################# - - - -### http://www.knora.org/ontology/knora-admin#belongsToInstitution - -:belongsToInstitution rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates which Institution a knoraProject belongs to"@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectClassConstraint :Institution . - - - -### http://www.knora.org/ontology/knora-admin#belongsToProject - -:belongsToProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates which knoraProject a UserGroup belongs to"@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#currentproject - -:currentproject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "This property indicates, which is the \"current project\" of a given user. A user can be part of any number of projects, but only one can be the active project."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#isInGroup - -:isInGroup rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given User is part of the given UserGroup"@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :UserGroup . - - - -### http://www.knora.org/ontology/knora-admin#isInProject - -:isInProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given User is part of the given knoraProject"@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#isAdminForProject - -:isInProjectAdminGroup rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given User is part of the given Project's ProjectAdmin group"@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -################################################################# -# -# Datatype properties -# -################################################################# - - -### http://www.knora.org/ontology/knora-admin#address - -:address rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - knora-base:objectDatatypeConstraint xsd:string ; - - rdfs:comment "Address of a person or an institution"@en . - - -### http://www.knora.org/ontology/knora-admin#groupName - -:groupName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The group's name"@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectDatatypeConstraint xsd:string ; - - rdfs:subPropertyOf . - - - -### http://www.knora.org/ontology/knora-admin#groupDescription - -:groupDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of a user group"@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#hasSelfJoinEnabled - -:hasSelfJoinEnabled rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if users can add themselves to the project or group"@en ; - - # No knora-base:subjectClassConstraint, because this can be used with :knoraProject or :UserGroup. - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-admin#institutionName - -:institutionName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The institutions's name"@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#institutionDescription - -:institutionDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of an institution"@en ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#institutionWebsite - -:institutionWebsite rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The URL of a web site"@en ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:anyURI . - - - -### http://www.knora.org/ontology/knora-admin#isActiveUser - -:isInSystemAdminGroup rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if the user is a member of the SystemAdmin group."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-admin#givenName - -:givenName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf foaf:givenName, :objectCannotBeMarkedAsDeleted ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#familyName - -:familyName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf foaf:familyName, :objectCannotBeMarkedAsDeleted ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#password - -:password rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "An encrypted credential for access"@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#phone - -:phone rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Phone number of a person, institution, etc."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#preferredLanguage - -:preferredLanguage rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Language (\"en\", \"de\", \"fr\", \"it\", \"gr\", etc.)"@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectDescription - -:projectDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of a Knora project"@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectKeyword - -:projectKeyword rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A keyword describing a project"@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectLongname - -:projectLongname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The longname of a Knora project"@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectLogo - -:projectLogo rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Path to the projects logo"@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectRestrictedViewSize - -:projectRestrictedViewSize rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The size of the image (as defined by IIIF) returned for restricted view"@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectRestrictedViewWatermark - -:projectRestrictedViewWatermark rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Path to the restricted view watermark"@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectShortname - -:projectShortname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The unique shortname of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectShortcode - -:projectShortcode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The unique short code of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#username - -:username rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The username and login name of a user of Knora"@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#email - -:email rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The email address and login name of a user of Knora"@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#status - -:status rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The status of the user / group / project. It is false if the entity has been deactivated (deleted)"@en ; - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -################################################################# -# -# Classes -# -################################################################# - - - -### http://www.knora.org/ontology/knora-admin#Institution - -:Institution rdf:type owl:Class ; - - rdfs:subClassOf foaf:Organization , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionDescription ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionWebsite ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :phone ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :address ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :email ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "An institution that has data in Knora"@en . - - - -### http://www.knora.org/ontology/knora-admin#User - -:User rdf:type owl:Class ; - - rdfs:subClassOf foaf:Person , - [ rdf:type owl:Restriction ; - owl:onProperty :username ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :email ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :familyName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :givenName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :password ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :preferredLanguage ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInProject ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInGroup ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInSystemAdminGroup ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a Knora user"@en . - - - -### http://www.knora.org/ontology/knora-admin#UserGroup - -:UserGroup rdf:type owl:Class ; - - rdfs:subClassOf foaf:Group , - [ rdf:type owl:Restriction ; - owl:onProperty :groupName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :groupDescription ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :belongsToProject ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:comment "A group of Knora users"@en . - - - - -### http://www.knora.org/ontology/knora-admin#knoraProject - -:knoraProject rdf:type owl:Class ; - - rdfs:subClassOf foaf:Project , - [ rdf:type owl:Restriction ; - owl:onProperty :projectShortname ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectShortcode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectLongname ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectDescription ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectKeyword ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectLogo ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectRestrictedViewSize ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectRestrictedViewWatermark ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :belongsToInstitution ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasSelfJoinEnabled ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a project that uses Knora"@en . - - - - -################################################################# -# -# Individuals -# -################################################################# - -### http://www.knora.org/ontology/knora-admin#UnknownUser -:UnknownUser rdf:type :UserGroup ; - :groupName "UnknownUser" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#KnownUser -:KnownUser rdf:type :UserGroup ; - :groupName "KnownUser" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#Creator -:Creator rdf:type :UserGroup ; - :groupName "Creator" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#ProjectMember -:ProjectMember rdf:type :UserGroup ; - :groupName "ProjectMember" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#ProjectAdmin -:ProjectAdmin rdf:type :UserGroup ; - :groupName "ProjectAdmin" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemAdmin -:SystemAdmin rdf:type :UserGroup ; - :groupName "SystemAdmin" ; - :belongsToProject :SystemProject ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemUser -:SystemUser rdf:type :User ; - rdfs:comment "A built-in system user."@en ; - :username "system"; - :email "system@localhost" ; - :givenName "Knora" ; - :familyName "System" ; - :password "-" ; - :status "true"^^xsd:boolean ; - :preferredLanguage "en" ; - :isInSystemAdminGroup "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#AnonymousUser -:AnonymousUser rdf:type :User ; - rdfs:comment "A built-in anonymous user."@en ; - :username "anonymous" ; - :email "anonymous@localhost" ; - :givenName "Knora" ; - :familyName "Anonymous" ; - :password "-" ; - :status "true"^^xsd:boolean ; - :preferredLanguage "en" ; - :isInSystemAdminGroup "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemProject -:SystemProject rdf:type :knoraProject ; - rdfs:comment "A built-in project representing the Knora System."@en ; - :projectShortname "SystemProject" ; - :projectShortcode "FFFF" ; - :projectLongname "Knora System Project" ; - :projectDescription "Knora System Project"@en ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - - -### http://www.knora.org/ontology/knora-admin#SharedOntologiesProject -:DefaultSharedOntologiesProject rdf:type :knoraProject ; - rdfs:comment "The default project for shared ontologies."@en ; - :projectShortname "DefaultSharedOntologiesProject" ; - :projectShortcode "0000" ; - :projectLongname "Knora Default Shared Ontologies Project" ; - :projectDescription "Knora Shared Ontologies Project"@en ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - -# -## -### Permission Class Properties -## -# -### http://www.knora.org/ontology/knora-admin#forProject - -:forProject rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a knoraProject."@en ; - knora-base:subjectClassConstraint :Permission ; - knora-base:objectClassConstraint :knoraProject . - -### http://www.knora.org/ontology/knora-admin#forGroup -:forGroup rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a UserGroup."@en ; - knora-base:subjectClassConstraint :Permission ; - knora-base:objectClassConstraint :UserGroup . - -### http://www.knora.org/ontology/knora-admin#forResourceClass -:forResourceClass rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a resource class."@en ; - knora-base:subjectClassConstraint :Permission . - -### http://www.knora.org/ontology/knora-admin#forProperty -:forProperty rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a resource property."@en ; - knora-base:subjectClassConstraint :Permission . - - -# -## -### Permission Class and Sub-Classes -## -# -### http://www.knora.org/ontology/knora-admin#Permission -:Permission rdf:type owl:Class ; - rdfs:comment "Base Permission class."@en. - - -### http://www.knora.org/ontology/knora-admin#AdministrativePermission -:AdministrativePermission rdf:type owl:Class ; - rdfs:comment "Administrative Permission class used to create instances for storing administrative permissions on groups."@en ; - rdfs:subClassOf :Permission . - -### http://www.knora.org/ontology/knora-admin#DefaultObjectAccessPermission -:DefaultObjectAccessPermission rdf:type owl:Class ; - rdfs:comment "Default Object Access Permission class used to create instances for storing default object access permission for a project and either groups, resource classes, or properties."@en ; - rdfs:subClassOf :Permission . diff --git a/upgrade/plugins/pr1307/knora-ontologies/knora-base.ttl b/upgrade/plugins/pr1307/knora-ontologies/knora-base.ttl deleted file mode 100644 index 51dadc6c60..0000000000 --- a/upgrade/plugins/pr1307/knora-ontologies/knora-base.ttl +++ /dev/null @@ -1,2691 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xml: . -@prefix xsd: . -@prefix foaf: . -@prefix dcterms: . -@prefix salsah-gui: . -@prefix knora-admin: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The Knora base ontology"@en ; - - :attachedToProject knora-admin:SystemProject ; - - :ontologyVersion "PR 1307" . - - - -################################################################# -# -# Properties -# -################################################################# - - - -### http://www.knora.org/ontology/knora-base#ontologyVersion - -:ontologyVersion rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates the version of the Knora built-in ontologies in a repository."@en ; - - :subjectClassConstraint owl:Ontology ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#isMainResource - -# This property is generated by a SPARQL CONSTRUCT query, it is not used in the triplestore and not used in the API - -:isMainResource rdf:type owl:DatatypeProperty ; - - rdfs:comment "Indicates if the given resource is the main resource of a request or a resource referred to by a link property."@en ; - - :subjectClassConstraint :Resource ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#objectCannotBeMarkedAsDeleted - -:objectCannotBeMarkedAsDeleted rdf:type rdf:Property ; - - rdfs:comment "The base property of properties whose objects can't be marked as deleted"@en . - - - -### http://www.knora.org/ontology/knora-base#objectDatatypeConstraint - -:objectDatatypeConstraint rdf:type owl:DatatypeProperty ; - - rdfs:comment "Specifies the type required as the object of a datatype property"@en . - - - -### http://www.knora.org/ontology/knora-base#resourceIcon - -:resourceIcon rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint owl:Class ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#resourceProperty - -:resourceProperty rdf:type owl:ObjectProperty ; - - rdfs:comment "The base property of properties that point from Knora resources to Knora resources or values. These properties are required to have cardinalities in the resource classes in which they are used."@en ; - - :subjectClassConstraint :Resource . - - - -### http://www.knora.org/ontology/knora-base#subjectClassConstraint - -:subjectClassConstraint rdf:type owl:ObjectProperty ; - - rdfs:comment "Specifies the OWL class that the subject of a property must belong to"@en . - - - -### http://www.knora.org/ontology/knora-base#objectClassConstraint - -:objectClassConstraint rdf:type owl:ObjectProperty ; - - rdfs:comment "Specifies the OWL class that the object of a property must belong to"@en . - - - -### http://www.knora.org/ontology/knora-base#isEditable - -:isEditable rdf:type owl:AnnotationProperty ; - - :objectDatatypeConstraint xsd:boolean ; - - rdfs:label "is editable"@en ; - - rdfs:comment "Indicates whether a property's values can be updated via the Knora API."@en . - - - -### http://www.knora.org/ontology/knora-base#canBeInstantiated - -:canBeInstantiated rdf:type owl:AnnotationProperty ; - - :subjectClassConstraint owl:Class ; - - :objectDatatypeConstraint xsd:boolean ; - - rdfs:label "can be instantiated"@en ; - - rdfs:comment "Indicates whether a resource class can be instantiated via the Knora API."@en . - - - -### http://www.knora.org/ontology/knora-base#attachedToProject - -:attachedToProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "attached to project"@en ; - - rdfs:comment "Connects something to a project"@en ; - - :objectClassConstraint knora-admin:knoraProject . - - - -### http://www.knora.org/ontology/knora-base#attachedToUser - -:attachedToUser rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "attached to user"@en ; - - rdfs:comment "Connects something to a user"@en ; - - :objectClassConstraint knora-admin:User . - - -### http://www.knora.org/ontology/knora-base#hasColor - -:hasColor rdf:type owl:ObjectProperty ; - - rdfs:label "Farbe"@de , - "Color"@en , - "Couleur"@fr , - "Colore"@it ; - - rdfs:comment """Specifies the color of a region."""@en ; - - salsah-gui:guiAttribute "ncolors=8"^^xsd:string ; - - :objectClassConstraint :ColorValue ; - - :subjectClassConstraint :Region ; - - rdfs:subPropertyOf :hasValue ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Colorpicker . - - - -### http://www.knora.org/ontology/knora-base#hasComment - -:hasComment rdf:type owl:ObjectProperty ; - - rdfs:label "Kommentar"@de , - "Comment"@en , - "Commentaire"@fr , - "Commento"@it ; - - rdfs:comment """Represents a comment on a resource as a knora-base:TextValue"""@de ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :TextValue ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Richtext ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasExtResValue - -:hasExtResValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat externen Wert"@de , - "has external Value"@en , - "a valeur externe"@fr , - "ha valore esterno"@it ; - - :objectClassConstraint :ExternalResValue ; - - :subjectClassConstraint :ExternalResource ; - - rdfs:subPropertyOf :hasValue . - - -### http://www.knora.org/ontology/knora-base#hasFileValue - -:hasFileValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :FileValue ; - - rdfs:label "hat Datei"@de , - "has file"@en , - "a fichier"@fr , - "ha file"@it ; - - rdfs:comment "Connects a Representation to a file"@en ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - :subjectClassConstraint :Representation ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasStillImageFileValue - -:hasStillImageFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Bilddatei"@de , - "has image file"@en , - "a fichier d'image"@fr , - "ha file imagine"@it ; - - rdfs:comment "Connects a Representation to an image file"@en ; - - :objectClassConstraint :StillImageFileValue ; - - :subjectClassConstraint :StillImageRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasMovingImageFileValue - -:hasMovingImageFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Filmdatei"@de , - "has movie file"@en , - "a fichier de film"@fr , - "ha file film"@it ; - - rdfs:comment "Connects a Representation to a movie file"@en ; - - :objectClassConstraint :MovingImageFileValue ; - - :subjectClassConstraint :MovingImageRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasAudioFileValue - -:hasAudioFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Audiodatei"@de , - "has audio file"@en , - "a fichier d'audio"@fr , - "ha file audio"@it ; - - rdfs:comment "Connects a Representation to an audio file"@en ; - - :objectClassConstraint :AudioFileValue ; - - :subjectClassConstraint :AudioRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasDDDFileValue - -:hasDDDFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat 3D-Datei"@de , - "has 3D-file"@en , - "a ficher de 3D"@fr , - "ha file 3D"@it ; - - rdfs:comment "Connects a Representation to a 3D-file"@en ; - - :objectClassConstraint :DDDFileValue ; - - :subjectClassConstraint :DDDRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasTextFileValue - -:hasTextFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Textdatei"@de , - "has text file"@en , - "a fichier de texte"@fr , - "ha file testo"@it ; - - rdfs:comment "Connects a Representation to a text file"@en ; - - :objectClassConstraint :TextFileValue ; - - :subjectClassConstraint :TextRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasDocumentFileValue - -:hasDocumentFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Dokument"@de , - "has document"@en , - "a document"@fr , - "ha documento"@it ; - - rdfs:comment "Connects a Representation to a document"@en ; - - :objectClassConstraint :DocumentFileValue ; - - :subjectClassConstraint :DocumentRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasGeometry - -:hasGeometry rdf:type owl:ObjectProperty ; - - rdfs:label "Geometrie"@de , - "Geometry"@en , - "Géometrie"@fr , - "Geometria"@it ; - - rdfs:comment """Represents a geometrical shape."""@en ; - - rdfs:subPropertyOf :hasValue ; - - salsah-gui:guiElement salsah-gui:Geometry ; - - :isEditable true ; - - :objectClassConstraint :GeomValue ; - - :subjectClassConstraint :Region . - - - -### http://www.knora.org/ontology/knora-base#hasLinkTo - -:hasLinkTo rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :resourceProperty ; - - rdfs:label "hat Link zu"@de , - "has Link to"@en , - "a lien vers"@fr , - "ha Link verso"@it ; - - rdfs:comment "Represents a direct connection between two resources"@en ; - - :isEditable true ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :Resource . - - - -### http://www.knora.org/ontology/knora-base#hasLinkToValue - -:hasLinkToValue rdf:type owl:ObjectProperty ; - - rdfs:comment "Points to a LinkValue reification describing a link between two resources"@en ; - - rdfs:label "hat Link zu"@de , - "has Link to"@en , - "a lien vers"@fr , - "ha Link verso"@it ; - - rdfs:comment "Represents a direct connection between two resources"@en ; - - :isEditable true ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasRepresentation - -:hasRepresentation rdf:type owl:ObjectProperty ; - - rdfs:label "hat Repräsentation"@de , - "has Representation"@en , - "a Répresentation"@fr , - "ha Rappresentazione"@it ; - - rdfs:comment "References an instance of a Representation. A Representation contains the metadata of a digital object (= file) which represents some physical entity such as an image, a sound, an encoded text etc."@en ; - - :objectClassConstraint :Representation ; - - :subjectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#hasRepresentationValue - -:hasRepresentationValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - - -### http://www.knora.org/ontology/knora-base#hasStandoffLinkTo - -:hasStandoffLinkTo rdf:type owl:ObjectProperty ; - - rdfs:label "hat Standoff Link zu"@de , - "has Standoff Link to"@en , - "a standoff lien vers"@fr , - "ha standoff link verso"@it ; - - rdfs:comment "Repräsentiert einen Link im Standoff Markup von einer Ressource zu einer anderen"@de , - "Represents a link in standoff markup from one resource to another."@en ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#hasStandoffLinkToValue - -:hasStandoffLinkToValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Standoff Link zu"@de , - "has Standoff Link to"@en , - "a standoff lien vers"@fr , - "ha standoff link verso"@it ; - - rdfs:comment "Repräsentiert einen Link im Standoff Markup von einer Ressource zu einer anderen"@de , - "Represents a link in standoff markup from one resource to another."@en ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#standoffTagHasLink - -:standoffTagHasLink rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :StandoffLinkTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasInternalReference - -:standoffTagHasInternalReference rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :StandoffTag ; - - :subjectClassConstraint :StandoffInternalReferenceTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStart - -:standoffTagHasStart rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEnd - -:standoffTagHasEnd rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartIndex - -:standoffTagHasStartIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEndIndex - -:standoffTagHasEndIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartAncestor - -:standoffTagHasStartAncestor rdf:type owl:ObjectProperty, owl:TransitiveProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartParent - -:standoffTagHasStartParent rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted, :standoffTagHasStartAncestor ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEndParent - -:standoffTagHasEndParent rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasUUID - -:standoffTagHasUUID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:string . - - -:valueHasMaxStandoffStartIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#hasSubListNode - -:hasSubListNode rdf:type owl:ObjectProperty ; - - rdfs:comment "A hierarchical list is formed using the \"hasSubListNode\"-property"@en ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :ListNode ; - - :subjectClassConstraint :ListNode . - - -### http://www.knora.org/ontology/knora-base#hasValue - -:hasValue rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :resourceProperty ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :Value . - - -### http://www.knora.org/ontology/knora-base#isAnnotationOf - -:isAnnotationOf rdf:type owl:ObjectProperty ; - - rdfs:label "ist Annotation von"@de , - "is Annotation of"@en , - "est Annotation de"@fr , - "è Annotation di"@it ; - - :subjectClassConstraint :Annotation ; - - :objectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isAnnotationOfValue - -:isAnnotationOfValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Annotation ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#isPartOf - -:isPartOf rdf:type owl:ObjectProperty ; - - rdfs:label "ist Teil von"@de , - "is part of"@en , - "fait partie de"@fr , - "fa parte di"@it ; - - rdfs:comment "Indicates that this resource is part of another resource"@en ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isPartOfValue - -:isPartOfValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#isRegionOf - -:isRegionOf rdf:type owl:ObjectProperty ; - - rdfs:comment "Region of interest within a digital object (e.g. an image)"@en ; - - rdfs:label "is Region von"@de , - "is region of"@en , - "est région de"@fr , - "è regione di"@it ; - - :subjectClassConstraint :Region ; - - :objectClassConstraint :Representation ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isRegionOfValue - -:isRegionOfValue rdf:type owl:ObjectProperty ; - - rdfs:comment "Region of interest within a digital object (e.g. an image)"@en ; - - rdfs:label "is Region von"@de , - "is region of"@en , - "est région de"@fr , - "è regione di"@it ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Region ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#previousValue - -:previousValue rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "Points to the previous verson of a value"@en ; - - :subjectClassConstraint :Value ; - - :objectClassConstraint :Value . - - - -### http://www.knora.org/ontology/knora-base#seqnum - -:seqnum rdf:type owl:ObjectProperty ; - - :objectClassConstraint :IntValue ; - - rdfs:subPropertyOf :hasValue ; - - rdfs:label "Sequenznummer"@de , - "Sequence number"@en , - "Numéro de séquence"@fr , - "Numero di sequenza"@it ; - - rdfs:comment "Indicates the position of a resource within a sequence"@en . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasOriginalXMLID - -:standoffTagHasOriginalXMLID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:string ; - - :subjectClassConstraint :StandoffTag . - - - -### http://www.knora.org/ontology/knora-base#valueHasStandoff - -:valueHasStandoff rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :objectClassConstraint :StandoffTag ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#valueHasLanguage - -:valueHasLanguage rdf:type owl:DatatypeProperty ; - - :objectDatatypeConstraint xsd:string ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#valueHasMapping - -:valueHasMapping rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :objectClassConstraint :XMLToStandoffMapping ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#hasMappingElement - -:hasMappingElement rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "mapping element"@en ; - - rdfs:comment """Represents an element in a mapping"""@en ; - - :subjectClassConstraint :XMLToStandoffMapping ; - - :objectClassConstraint :MappingElement . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLTagname - -:mappingHasXMLTagname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML tag"@en ; - - rdfs:comment """name of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLNamespace - -:mappingHasXMLNamespace rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "namespace of the XML tag"@en ; - - rdfs:comment """namespace of the XML tag"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLClass - -:mappingHasXMLClass rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "class of the XML tag"@en ; - - rdfs:comment """class of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffClass - -:mappingHasStandoffClass rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "IRI of the standoff class"@en ; - - rdfs:comment """IRI of the standoff class"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectClassConstraint owl:Class . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLAttribute - -:mappingHasXMLAttribute rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML attribute"@en ; - - rdfs:comment """name of the XML attribute"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectClassConstraint :MappingXMLAttribute . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLAttributename - -:mappingHasXMLAttributename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML attribute"@en ; - - rdfs:comment """name of the XML attribute"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffProperty - -:mappingHasStandoffProperty rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "IRI of the standoff property"@en ; - - rdfs:comment """IRI of the standoff property"""@en ; - - :subjectClassConstraint :MappingXMLAttribute . - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffDataTypeClass - -:mappingHasStandoffDataTypeClass rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "datatype of the XML tag"@en ; - - rdfs:comment """datatype of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectClassConstraint :MappingStandoffDataTypeClass . - - -### http://www.knora.org/ontology/knora-base#mappingElementRequiresSeparator - -:mappingElementRequiresSeparator rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "indicates if the element requires a separator in the text"@en ; - - rdfs:comment """indicates if the element requires a separator in the text"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:boolean . - - -### http://www.knora.org/ontology/knora-base#mappingHasDefaultXSLTransformation - -:mappingHasDefaultXSLTransformation rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "default XSL Transformation"@en ; - - rdfs:comment """default XSL Transformation for this mapping"""@en ; - - :subjectClassConstraint :XMLToStandoffMapping ; - - :objectClassConstraint :XSLTransformation . - - -### http://www.knora.org/ontology/knora-base#deletedBy - -:deletedBy rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates who deleted a resource or value"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectClassConstraint knora-admin:User . - - -################################################################# -# -# Datatype properties -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#creationDate - -:creationDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates when a resource was created"@en ; - - :subjectClassConstraint :Resource ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#deleteDate - -:deleteDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates when a resource or value was deleted"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:dateTime . - - -### http://www.knora.org/ontology/knora-base#dimX - -:dimX rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :FileValue ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#dimY - -:dimY rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :FileValue ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#duration - -:duration rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#extResAccessInfo - -:extResAccessInfo rdf:type owl:DatatypeProperty ; - - rdfs:comment "Information (URL etc.) for accessing an external resource"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#extResId - -:extResId rdf:type owl:DatatypeProperty ; - - rdfs:comment "The ID of the external resource. The form of the ID is dependent on the provider."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#extResProvider - -:extResProvider rdf:type owl:DatatypeProperty ; - - rdfs:comment "The name of the external provider of the resource"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - - -### http://www.knora.org/ontology/knora-base#fps - -:fps rdf:type owl:DatatypeProperty ; - - rdfs:label "Frames per second"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :MovingImageFileValue ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#internalFilename - -:internalFilename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#internalMimeType - -:internalMimeType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#isDeleted - -:isDeleted rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if the resource has been deleted"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#isRootNode - -:isRootNode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#hasRootNode - -:hasRootNode rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint :ListNode . - - - - -### http://www.knora.org/ontology/knora-base#lastModificationDate - -:lastModificationDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#listNodePosition - -:listNodePosition rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#listNodeName - -:listNodeName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#originalFilename - -:originalFilename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#originalMimeType - -:originalMimeType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasComment - -:valueHasComment rdf:type owl:DatatypeProperty ; - - rdfs:comment "A comment on a value"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#deleteComment - -:deleteComment rdf:type owl:DatatypeProperty ; - - rdfs:comment "A comment explaining why a resource or value was marked as deleted"@en ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueCreationDate - -:valueCreationDate rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :Value ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#valueHas - -:valueHas rdf:type rdf:Property ; - - :subjectClassConstraint :ValueBase ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted . - - - -### http://www.knora.org/ontology/knora-base#valueHasCalendar - -:valueHasCalendar rdf:type owl:DatatypeProperty ; - - rdfs:comment "Name of the calendar to be used, such as \"GREGORIAN\" or \"JULIAN\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasColor - -:valueHasColor rdf:type owl:DatatypeProperty ; - - rdfs:comment "Color in the form of #rrggbb (as defining web colors)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ColorBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasEndJDN - -:valueHasEndJDN rdf:type owl:DatatypeProperty ; - - rdfs:comment "Contains the end of a date as a Julian Day Number (JDN)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasEndPrecision - -:valueHasEndPrecision rdf:type owl:DatatypeProperty ; - - rdfs:comment "Precision of knowledge about the end of the date. Allowed are \"DAY\", \"MONTH\" or \"YEAR\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasDecimal - -:valueHasDecimal rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DecimalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasGeometry - -:valueHasGeometry rdf:type owl:DatatypeProperty ; - - rdfs:comment "JSON string describing a geometry (e.g. a region). Currently geometries are limited to 2D unions of primitive objects like circles, squares and polygons."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :GeomValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasGeonameCode - -:valueHasGeonameCode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :GeonameValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasInteger - -:valueHasInteger rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasBoolean - -:valueHasBoolean rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :BooleanBase ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#valueHasUri - -:valueHasUri rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :UriBase ; - - :objectDatatypeConstraint xsd:anyURI . - - - -### http://www.knora.org/ontology/knora-base#valueHasIntervalEnd - -:valueHasIntervalEnd rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntervalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasIntervalStart - -:valueHasIntervalStart rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntervalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasListNode - -:valueHasListNode rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ListValue ; - - :objectClassConstraint :ListNode . - - - -### http://www.knora.org/ontology/knora-base#valueHasOrder - -:valueHasOrder rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#valueHasRefCount - -:valueHasRefCount rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :LinkValue ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasStartJDN - -:valueHasStartJDN rdf:type owl:DatatypeProperty ; - - rdfs:comment "Contains the start of a date as a Julian Day Number (JDN)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasStartPrecision - -:valueHasStartPrecision rdf:type owl:DatatypeProperty ; - - rdfs:comment "The precision the start of a date. Allowed values are \"DAY\", \"MONTH\", or \"YEAR\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasString - -:valueHasString rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "A string representation of a value, required for full-text searches and search results."@en ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#hasPermissions - -:hasPermissions rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:string . - - - -################################################################# -# -# Classes -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#Annotation - -:Annotation rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isAnnotationOf ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isAnnotationOfValue ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Annotation"@de , - "Annotation"@en , - "Annotation"@fr , - "Annotation"@it ; - - :canBeInstantiated true ; - - rdfs:comment "A generic class for representing annotations"@en . - - - -### http://www.knora.org/ontology/knora-base#AudioFileValue - -:AudioFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :duration ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents an audio file"@en . - - - -### http://www.knora.org/ontology/knora-base#AudioRepresentation - -:AudioRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasAudioFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Audio)"@de , - "Representation (Audio)"@en , - "Répresentation (Audio)"@fr , - "Rappresentazione (Audio)"@it ; - - rdfs:comment "Represents a file containing audio data"@en . - - -### http://www.knora.org/ontology/knora-base#ColorBase - -:ColorBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasColor ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#ColorValue - -:ColorValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :ColorBase ; - - rdfs:comment "Represents a color in HTML format, e.g. \"#33eeff\""@en . - - - -### http://www.knora.org/ontology/knora-base#DDDFileValue - -:DDDFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue ; - - rdfs:comment "This represents some 3D-object with mesh data, point cloud, etc."@en . - - - -### http://www.knora.org/ontology/knora-base#DDDRepresentation - -:DDDRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasDDDFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (3D)"@de , - "Representation (3D)"@en , - "Répresentation (3D)"@fr , - "Rappresentazione (3D)"@it ; - - rdfs:comment "Represents a file containg 3D data"@en . - - -### http://www.knora.org/ontology/knora-base#DateBase - -:DateBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasCalendar ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasEndPrecision ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasEndJDN ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStartPrecision ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStartJDN ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#DateValue - -:DateValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :DateBase ; - - rdfs:comment "Represents a Knora date value"@en . - - - -### http://www.knora.org/ontology/knora-base#DocumentFileValue - -:DocumentFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue . - - - -### http://www.knora.org/ontology/knora-base#DocumentRepresentation - -:DocumentRepresentation rdf:type owl:Class ; - - rdfs:label "Repräsentation (Dokument)"@de , - "Representation (Document)"@en , - "Répresentation (Document)"@fr , - "Rappresentazione (Documento)"@it ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasDocumentFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ExternalResValue - -:ExternalResValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :extResId ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :extResProvider ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :extResAccessInfo ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ExternalResource - -:ExternalResource rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasExtResValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Externe Ressource"@de , - "External Resource"@en , - "Ressource Externe"@fr , - "Risorsa esterna"@it ; - - rdfs:comment "Represents a proxy for an object stored by an external provider"@en . - - - -### http://www.knora.org/ontology/knora-base#FileValue - -:FileValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :originalMimeType ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :internalFilename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :internalMimeType ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :originalFilename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#DecimalBase - -:DecimalBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasDecimal ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#DecimalValue - -:DecimalValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :DecimalBase ; - - rdfs:comment "Represents an arbitrary-precision decimal value"@en . - - - -### http://www.knora.org/ontology/knora-base#GeomValue - -:GeomValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasGeometry ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a geometrical objects as JSON string"@en . - - - -### http://www.knora.org/ontology/knora-base#GeonameValue - -:GeonameValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasGeonameCode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#IntBase - -:IntBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasInteger ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#IntValue - -:IntValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :IntBase ; - - rdfs:comment "Represents an integer value"@en . - -### http://www.knora.org/ontology/knora-base#BooleanBase - -:BooleanBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasBoolean ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#BooleanValue - -:BooleanValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :BooleanBase ; - - rdfs:comment "Represents a boolean value"@en . - - - -### http://www.knora.org/ontology/knora-base#UriBase - -:UriBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasUri ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - -### http://www.knora.org/ontology/knora-base#UriValue - -:UriValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :UriBase ; - - rdfs:comment "Represents a URI"@en . - -### http://www.knora.org/ontology/knora-base#IntervalBase - -:IntervalBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasIntervalEnd ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasIntervalStart ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#IntervalValue - -:IntervalValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :IntervalBase ; - - rdfs:comment "Represents a time interval, e.g. in an audio recording"@en . - - - -### http://www.knora.org/ontology/knora-base#LinkObj - -:LinkObj rdf:type owl:Class ; - - rdfs:label "Verknüpfungsobjekt"@de , - "Link Object"@en , - "Objet de lien"@fr , - "Oggetto di connessione"@it ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasLinkTo ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasLinkToValue ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - :resourceIcon "link.gif"^^xsd:string ; - - :canBeInstantiated true ; - - rdfs:comment "Verknüpfung mehrerer Resourcen"@de , - "Represents a generic link object"@en . - - - -### http://www.knora.org/ontology/knora-base#LinkValue - -:LinkValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - rdf:Statement , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasRefCount ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:subject ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:predicate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:object ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "A reification node that describes direct links between resources"@en . - - - -### http://www.knora.org/ontology/knora-base#ListNode - -:ListNode rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :hasSubListNode ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :listNodePosition ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :listNodeName ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRootNode ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasRootNode ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToProject ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdfs:label ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:comment "Represents a flat or hierarchical list"@en . - - - -### http://www.knora.org/ontology/knora-base#ListValue - -:ListValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasListNode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#MovingImageFileValue - -:MovingImageFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :dimX ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :dimY ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :fps ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :duration ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a moving image file"@en . - - - -### http://www.knora.org/ontology/knora-base#MovingImageRepresentation - -:MovingImageRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasMovingImageFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Video)"@de , - "Representation (Movie)"@en , - "Répresentation (Film)"@fr , - "Rappresentazione (Film)"@it ; - - rdfs:comment "A resource containing moving image data"@en . - - - -### http://www.knora.org/ontology/knora-base#Region - -:Region rdf:type owl:Class ; - - rdfs:label "Region"@de , - "Region"@en , - "Région"@fr , - "Regione"@it ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasColor ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRegionOf ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasGeometry ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRegionOfValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - :resourceIcon "region.gif"^^xsd:string ; - - :canBeInstantiated true ; - - rdfs:comment "Represents a geometric region of a resource. The geometry is represented currently as JSON string."@en . - - - -### http://www.knora.org/ontology/knora-base#Representation - -:Representation rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation"@de , - "Representation"@en , - "Répresentation"@fr , - "Rappresentazione"@it ; - - rdfs:comment "A resource that can store a file"@en . - - - -### http://www.knora.org/ontology/knora-base#Resource - -:Resource rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty rdfs:label ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isDeleted ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStandoffLinkTo ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStandoffLinkToValue ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToUser ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToProject ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasPermissions ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :creationDate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :lastModificationDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deletedBy ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Ressource"@de , - "Resource"@en , - "Ressource"@fr , - "Risorsa"@it ; - - rdfs:comment "Represents something in the world, or an abstract thing"@en . - - -################################################################# -# -# Generic Standoff Tag -# -################################################################# - - -:standoffParentClassConstraint rdf:type owl:ObjectProperty . - - -### http://www.knora.org/ontology/knora-base#StandoffTag - -:StandoffTag rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStart ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEnd ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasUUID ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasOriginalXMLID ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStartIndex ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEndIndex ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStartParent ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEndParent ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffParentClassConstraint; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a standoff markup tag"@en . - - - -################################################################# -# -# Abstract Standoff Data Type Tag -# -################################################################# - -### http://www.knora.org/ontology/knora-base#StandoffDataTypeTag - -:StandoffDataTypeTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffTag ; - - rdfs:comment "Represents a knora-base value type in a TextValue"@en . - - -################################################################# -# -# Standoff Data Type Tags that can be instantiated -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#StandoffLinkTag - -:StandoffLinkTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasLink ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a reference to a Knora resource in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffUriTag - -:StandoffUriTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag , - :UriBase ; - - rdfs:comment "Represents an arbitrary URI in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffDateTag - -:StandoffDateTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :DateBase ; - - rdfs:comment "Represents a date in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffColorTag - -:StandoffColorTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :ColorBase ; - - rdfs:comment "Represents a color in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffIntegerTag - -:StandoffIntegerTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :IntBase ; - - rdfs:comment "Represents an integer value in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffDecimalTag - -:StandoffDecimalTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :DecimalBase ; - - rdfs:comment "Represents a decimal (floating point) value in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffIntervalTag - -:StandoffIntervalTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :IntervalBase ; - - rdfs:comment "Represents an interval in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffBooleanTag - -:StandoffBooleanTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :BooleanBase ; - - rdfs:comment "Represents a boolean in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffInternalReferenceTag - -:StandoffInternalReferenceTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :ValueBase, - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasInternalReference ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents an internal reference in a TextValue"@en . - - - -### http://www.knora.org/ontology/knora-base#StillImageFileValue - -:StillImageFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :dimY ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :dimX ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "A file containing a two-dimensional still image"@en . - - - -### http://www.knora.org/ontology/knora-base#StillImageRepresentation - -:StillImageRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStillImageFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Bild)"@de , - "Representation (Image)"@en , - "Répresentation (Image)"@fr , - "Rappresentazione (Imagine)"@it ; - - rdfs:comment "A resource that can contain a two-dimensional still image file"@en . - - - -### http://www.knora.org/ontology/knora-base#TextFileValue - -:TextFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue ; - - rdfs:comment "A text file such as plain Unicode text, LaTeX, TEI/XML, etc."@en . - - - -### http://www.knora.org/ontology/knora-base#TextRepresentation - -:TextRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasTextFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Text)"@de , - "Representation (Text)"@en , - "Répresentation (Texte)"@fr , - "Rappresentazione (testo)"@it ; - - rdfs:comment "A resource containing a text file"@en . - - -### http://www.knora.org/ontology/knora-base#ForbiddenResource - -:ForbiddenResource rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ]; - - rdfs:label """A ForbiddenResource is a proxy for a resource that the client has insufficient permissions to see."""@en ; - - rdfs:comment """A ForbiddenResource is a proxy for a resource that the client has insufficient permissions to see."""@en . - -### http://www.knora.org/ontology/knora-base#XSLTransformation - -:XSLTransformation rdf:type owl:Class ; - - rdfs:subClassOf :TextRepresentation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasTextFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "a TextRepresentation representing an XSL transformation that can be applied to an XML created from standoff. The transformation's result is ecptected to be HTML."@en ; - - rdfs:comment "a TextRepresentation representing an XSL transformation that can be applied to an XML created from standoff. The transformation's result is ecptected to be HTML."@en . - - -### http://www.knora.org/ontology/knora-base#MappingComponent - -:MappingComponent rdf:type owl:Class ; - - rdfs:label "Component of a mapping"@en ; - - rdfs:comment "Component of a mapping" . - - -### http://www.knora.org/ontology/knora-base#MappingStandoffDataTypeClass - -:MappingStandoffDataTypeClass rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttributename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffClass ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML attributes to standoff properties"@en ; - - rdfs:comment "Mapping from XML attributes to standoff properties" . - - -### http://www.knora.org/ontology/knora-base#MappingXMLAttribute - -:MappingXMLAttribute rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttributename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLNamespace ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffProperty ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML attributes to standoff properties"@en ; - - rdfs:comment "Mapping from XML attributes to standoff properties" . - - -### http://www.knora.org/ontology/knora-base#MappingElement - -:MappingElement rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLTagname ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLNamespace ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLClass ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffClass ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttribute ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffDataTypeClass ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingElementRequiresSeparator ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML to standoff entities"@en ; - - rdfs:comment "Mapping from XML to standoff entities" . - -### http://www.knora.org/ontology/knora-base#XMLToStandoffMapping - -:XMLToStandoffMapping rdf:type owl:Class ; - - rdfs:subClassOf - [ rdf:type owl:Restriction ; - owl:onProperty :hasMappingElement ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasDefaultXSLTransformation ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Mapping from XML to standoff entities"@en ; - - rdfs:comment "Mapping from XML to standoff entities" . - -### http://www.knora.org/ontology/knora-base#TextValue - -:TextValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStandoff ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasMaxStandoffStartIndex ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasLanguage ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasMapping ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ValueBase - -:ValueBase rdf:type owl:Class . - - -### http://www.knora.org/ontology/knora-base#Value - -:Value rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase, - [ rdf:type owl:Restriction ; - owl:onProperty :valueCreationDate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToUser ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasPermissions ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasOrder ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isDeleted ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deletedBy ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :previousValue ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasString ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "The base class of classes representing Knora values"@en . diff --git a/upgrade/plugins/pr1307/knora-ontologies/salsah-gui.ttl b/upgrade/plugins/pr1307/knora-ontologies/salsah-gui.ttl deleted file mode 100644 index 6c183c0f51..0000000000 --- a/upgrade/plugins/pr1307/knora-ontologies/salsah-gui.ttl +++ /dev/null @@ -1,237 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix owl: . -@prefix rdf: . -@prefix xml: . -@prefix xsd: . -@prefix rdfs: . -@prefix knora-base: . -@prefix knora-admin: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The salsah-gui ontology"@en ; - - knora-base:attachedToProject knora-admin:SystemProject . - - -################################################################# -# -# Properties -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#guiOrder - -:guiOrder rdf:type owl:DatatypeProperty ; - - knora-base:subjectClassConstraint owl:Restriction ; - - knora-base:objectDatatypeConstraint xsd:nonNegativeInteger . - - - -### http://www.knora.org/ontology/salsah-gui#guiElement - -:guiElement rdf:type owl:ObjectProperty . - - - -### http://www.knora.org/ontology/salsah-gui#guiAttribute - -:guiAttribute rdf:type owl:DatatypeProperty ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/salsah-gui#guiAttributeDefinition - -:guiAttributeDefinition rdf:type owl:DatatypeProperty ; - - knora-base:subjectClassConstraint :Guielement ; - - knora-base:objectDatatypeConstraint xsd:string . - - - - - -################################################################# -# -# Classes -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#Guielement - -:Guielement rdf:type owl:Class . - - - - - -################################################################# -# -# Individuals -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#Colorpicker - -:Colorpicker rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "ncolors:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#Date - -:Date rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Geometry - -:Geometry rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Geonames - -:Geonames rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Iconclass - -# :Iconclass rdf:type :Guielement , -# owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Interval - -:Interval rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#List - -:List rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Pulldown - -:Pulldown rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Radio - -:Radio rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Richtext - -:Richtext rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Searchbox - -:Searchbox rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "numprops:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#SimpleText - -:SimpleText rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "size:integer" , - "maxlength:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#Slider - -:Slider rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "max(required):decimal" , - "min(required):decimal" . - - - -### http://www.knora.org/ontology/salsah-gui#Spinbox - -:Spinbox rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "max:decimal" , - "min:decimal" . - - - -### http://www.knora.org/ontology/salsah-gui#Textarea - -:Textarea rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "cols:integer" , - "rows:integer" , - "width:percent" , - "wrap:string(soft|hard)" . - - -### http://www.knora.org/ontology/salsah-gui#Checkbox - -:Checkbox rdf:type :Guielement , - owl:NamedIndividual . - - -### http://www.knora.org/ontology/salsah-gui#Fileupload - -:Fileupload rdf:type :Guielement , - owl:NamedIndividual . diff --git a/upgrade/plugins/pr1307/knora-ontologies/standoff-onto.ttl b/upgrade/plugins/pr1307/knora-ontologies/standoff-onto.ttl deleted file mode 100644 index f5113c5028..0000000000 --- a/upgrade/plugins/pr1307/knora-ontologies/standoff-onto.ttl +++ /dev/null @@ -1,356 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix xml: . -@prefix xsd: . -@prefix rdf: . -@prefix rdfs: . -@prefix owl: . -@prefix foaf: . -@prefix knora-base: . -@prefix knora-admin: . -@prefix salsah-gui: . -@base . - -@prefix : . - - rdf:type owl:Ontology ; - - rdfs:label "The standoff ontology"@en ; - - knora-base:attachedToProject knora-admin:SystemProject . - - -################################################################# -# -# Standoff Properties -# -################################################################# - -### http://www.knora.org/ontology/standoff#standoffRootTagHasDocumentType - -:standoffRootTagHasDocumentType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "describes the document type"@en ; - - knora-base:subjectClassConstraint :StandoffRootTag ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/standoff#standoffHyperlinkTagHasTarget - -:standoffHyperlinkTagHasTarget rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "describes the target settings of a hyperlink"@en ; - - knora-base:subjectClassConstraint :StandoffHyperlinkTag ; - - knora-base:objectDatatypeConstraint xsd:string . - - -################################################################# -# -# Intermediate Standoff Tags -# -################################################################# - -### http://www.knora.org/ontology/standoff#StandoffVisualTag - -:StandoffVisualTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag ; - - rdfs:comment "Represents visual markup information in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffStructuralTag - -:StandoffStructuralTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag ; - - rdfs:comment "Represents structural markup information in a TextValue"@en . - - -################################################################# -# -# Standoff Tags that can be instantiated -# -################################################################# - - -### http://www.knora.org/ontology/standoff#StandoffRootTag - -:StandoffRootTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffRootTagHasDocumentType ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents the root node if the TextValue has been created from XML"@en . - -### http://www.knora.org/ontology/standoff#StandoffHyperlinkTag - -:StandoffHyperlinkTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffUriTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffHyperlinkTagHasTarget ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a hyperlink in a text"@en . - -### http://www.knora.org/ontology/standoff#StandoffBlockquoteTag - -:StandoffBlockquoteTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a section that is quoted from another source in a text"@en . - - -### http://www.knora.org/ontology/standoff#StandoffCodeTag - -:StandoffCodeTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a section of computer source code in a text"@en . - - -### http://www.knora.org/ontology/standoff#StandoffParagraphTag - -:StandoffParagraphTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a paragraph in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader1Tag - -:StandoffHeader1Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 1 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader2Tag - -:StandoffHeader2Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 2 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader3Tag - -:StandoffHeader3Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 3 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader4Tag - -:StandoffHeader4Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 4 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader5Tag - -:StandoffHeader5Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 5 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader6Tag - -:StandoffHeader6Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 6 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffOrderedListTag - -:StandoffOrderedListTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents an ordered list in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffUnorderedListTag - -:StandoffUnorderedListTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents an unordered list in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffListElementTag - -:StandoffListElementTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a list element in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableBodyTag - -:StandoffTableBodyTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a table body in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableTag - -:StandoffTableTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a table in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableRowTag - -:StandoffTableRowTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a row in a table"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableCellTag - -:StandoffTableCellTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a cell in a table"@en . - - -### http://www.knora.org/ontology/standoff#StandoffBrTag - -:StandoffBrTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a linebreak"@en . - - - -### http://www.knora.org/ontology/standoff#StandoffItalicTag - -:StandoffItalicTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents italics in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffBoldTag - -:StandoffBoldTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents bold text in a TextValue"@en . - -### http://www.knora.org/ontology/standoff-html-editor#StandoffCiteTag - -:StandoffCiteTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents the title of a work in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffUnderlineTag - -:StandoffUnderlineTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents underlined text in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffStrikethroughTag - -:StandoffStrikethroughTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents struck text in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffSuperscriptTag - -:StandoffSuperscriptTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents superscript in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffSubscriptTag - -:StandoffSubscriptTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents subscript in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff-html-editor#StandoffLineTag - -:StandoffLineTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents a line to seperate content in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff-html-editor#StandoffPreTag - -:StandoffPreTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents a preformatted content in a TextValue"@en . diff --git a/upgrade/plugins/pr1307/test_1307.py b/upgrade/plugins/pr1307/test_1307.py deleted file mode 100644 index cc087b5c6f..0000000000 --- a/upgrade/plugins/pr1307/test_1307.py +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright @ 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - - -import tempfile -import rdflib -from rdflib.term import URIRef, Literal -from rdflib.namespace import XSD -from plugins.pr1307.update import GraphTransformer - -save_output = False - - -def test_update(): - input_graph = rdflib.Graph() - input_graph.parse("plugins/pr1307/test_data.ttl", format="turtle") - transformer = GraphTransformer() - output_graph = transformer.transform(input_graph) - - query_result = output_graph.query( - """ - PREFIX knora-base: - - SELECT ?s ?maxStartIndex WHERE { - ?s knora-base:valueHasMaxStandoffStartIndex ?maxStartIndex . - } - """ - ) - - max_start_index = set([(row["s"], row["maxStartIndex"]) for row in query_result]) - - assert max_start_index == { - ( - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ"), - Literal("7", datatype=XSD.integer) - ) - } - - query_result = output_graph.query( - """ - PREFIX knora-base: - - SELECT ?tag WHERE { - knora-base:valueHasStandoff ?tag . - } - """ - ) - - tags = set([row["tag"] for row in query_result]) - - assert tags == { - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/0"), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1"), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/2"), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/3"), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/4"), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/5"), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/6"), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/7") - } - - query_result = output_graph.query( - """ - PREFIX knora-base: - - SELECT ?tag ?startIndex ?startParent WHERE { - ?tag knora-base:standoffTagHasStartIndex ?startIndex . - - OPTIONAL { - ?tag knora-base:standoffTagHasStartParent ?startParent . - } - } - """ - ) - - tag_data = set([(row["tag"], row["startIndex"], row["startParent"]) for row in query_result]) - - assert tag_data == { - ( - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/0"), - Literal("0", datatype=XSD.integer), - None - ), - ( - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1"), - Literal("1", datatype=XSD.integer), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/0") - ), - ( - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/2"), - Literal("2", datatype=XSD.integer), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1") - ), - ( - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/3"), - Literal("3", datatype=XSD.integer), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1") - ), - ( - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/4"), - Literal("4", datatype=XSD.integer), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1") - ), - ( - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/5"), - Literal("5", datatype=XSD.integer), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1") - ), - ( - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/6"), - Literal("6", datatype=XSD.integer), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1") - ), - ( - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/7"), - Literal("7", datatype=XSD.integer), - URIRef("http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1") - ) - } - - if save_output: - temp_dir = tempfile.mkdtemp() - output_file_path = temp_dir + "/output.ttl" - output_graph.serialize(destination=output_file_path, format="turtle") - print("Wrote output to", output_file_path) diff --git a/upgrade/plugins/pr1307/test_data.ttl b/upgrade/plugins/pr1307/test_data.ttl deleted file mode 100644 index c9812af874..0000000000 --- a/upgrade/plugins/pr1307/test_data.ttl +++ /dev/null @@ -1,99 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . -@prefix owl: . -@prefix knora-base: . -@prefix knora-admin: . -@prefix standoff: . -@prefix anything: . - - - a anything:Thing; - rdfs:label "Something with a lot of markup"; - knora-base:isDeleted false; - knora-base:attachedToProject ; - knora-base:creationDate "2018-05-30T13:44:11.749Z"^^xsd:dateTime; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:KnownUser|RV knora-admin:UnknownUser"; - knora-base:attachedToUser ; - anything:hasRichtext . - - a knora-base:TextValue; - knora-base:isDeleted false; - knora-base:valueHasStandoff , - , - , - , - , - , - , - ; - knora-base:valueHasMapping ; - knora-base:valueCreationDate "2018-05-30T13:44:11.749Z"^^xsd:dateTime; - knora-base:valueHasOrder 0; - knora-base:valueHasString "Something with a lot of different markup. And more markup."; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:KnownUser|RV knora-admin:UnknownUser"; - knora-base:attachedToUser . - - - a standoff:StandoffBoldTag; - knora-base:standoffTagHasStart 0; - knora-base:standoffTagHasEnd 9; - knora-base:standoffTagHasStartIndex 2; - knora-base:standoffTagHasStartParent ; - knora-base:standoffTagHasUUID "7f3af890-c77d-4bf8-a81c-6786632520dd" . - - - a standoff:StandoffSuperscriptTag; - knora-base:standoffTagHasStart 34; - knora-base:standoffTagHasEnd 40; - knora-base:standoffTagHasStartIndex 6; - knora-base:standoffTagHasStartParent ; - knora-base:standoffTagHasUUID "e2ab65d2-6c80-494e-88ba-66767ed885f9" . - - - a standoff:StandoffParagraphTag; - knora-base:standoffTagHasStart 0; - knora-base:standoffTagHasEnd 58; - knora-base:standoffTagHasStartIndex 1; - knora-base:standoffTagHasStartParent ; - knora-base:standoffTagHasUUID "f3c0773a-2eb3-4d2e-9a6f-c8f2582a146e" . - - - a knora-base:StandoffUriTag; - knora-base:standoffTagHasStart 51; - knora-base:standoffTagHasEnd 57; - knora-base:standoffTagHasStartIndex 7; - knora-base:standoffTagHasStartParent ; - knora-base:standoffTagHasUUID "7b9f4609-3ba6-43e5-b945-d4329a155ca7"; - knora-base:valueHasUri "http://www.google.ch"^^xsd:anyURI . - - - a standoff:StandoffUnderlineTag; - knora-base:standoffTagHasStart 24; - knora-base:standoffTagHasEnd 33; - knora-base:standoffTagHasStartIndex 5; - knora-base:standoffTagHasStartParent ; - knora-base:standoffTagHasUUID "df348cfa-c362-45e6-9e13-601442214064" . - - - a standoff:StandoffRootTag; - knora-base:standoffTagHasStart 0; - knora-base:standoffTagHasEnd 59; - knora-base:standoffTagHasStartIndex 0; - knora-base:standoffTagHasUUID "c41e4e78-8b4f-47fc-9d17-8af0a279c80c" . - - - a standoff:StandoffItalicTag; - knora-base:standoffTagHasStart 10; - knora-base:standoffTagHasEnd 14; - knora-base:standoffTagHasStartIndex 3; - knora-base:standoffTagHasStartParent ; - knora-base:standoffTagHasUUID "13f66d42-2b1f-4fb4-91aa-6c55e350b0f4" . - - - a standoff:StandoffStrikethroughTag; - knora-base:standoffTagHasStart 17; - knora-base:standoffTagHasEnd 20; - knora-base:standoffTagHasStartIndex 4; - knora-base:standoffTagHasStartParent ; - knora-base:standoffTagHasUUID "0aaa6e47-0e9b-494f-9b6a-f42c66471d30" . diff --git a/upgrade/plugins/pr1307/update.py b/upgrade/plugins/pr1307/update.py deleted file mode 100644 index 332e50a579..0000000000 --- a/upgrade/plugins/pr1307/update.py +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright @ 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - - -import rdflib -from rdflib.namespace import RDF, XSD -from updatelib import rdftools - - -# The IRI of knora-base:TextValue. -text_value_type = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#TextValue") - -# The IRI of knora-base:standoffTagHasStartParent. -standoff_tag_has_start_parent = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#standoffTagHasStartParent") - -# The IRI of knora-base:standoffTagHasEndParent. -standoff_tag_has_end_parent = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#standoffTagHasEndParent") - -# The IRI of knora-base:standoffTagHasStartIndex. -standoff_tag_has_start_index = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#standoffTagHasStartIndex") - -# The IRI of knora-base:valueHasStandoff. -value_has_standoff = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#valueHasStandoff") - -# The IRI of knora-base:valueHasMaxStandoffStartIndex. -value_has_max_standoff_start_index = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#valueHasMaxStandoffStartIndex") - - -# Updates standoff for PR 1307. -class GraphTransformer(rdftools.GraphTransformer): - def transform(self, graph): - # Check whether the transformation has already been done. - statements_with_max_start_index = graph.subject_objects(value_has_max_standoff_start_index) - - if not rdftools.generator_is_empty(statements_with_max_start_index): - print("This transformation seems to have been done already.") - return graph - - # Group the statements in the named graph by subject and by predicate. - grouped_statements = rdftools.group_statements(graph) - - # Collect all text values included in the grouped statements. - text_values = collect_text_values(grouped_statements) - - # A set of subjects that will be transformed and should therefore not be copied - # from the input graph. - old_subjs = set() - - # A set of transformed statements to be included in the output graph. - transformed_statements = {} - - # Transform text values. - for text_value in text_values: - old_subjs.add(text_value.subj) - - for standoff_tag_old_subj in text_value.standoff_tags.keys(): - old_subjs.add(standoff_tag_old_subj) - - transformed_statements.update(text_value.transform_statements()) - - # Copy all non-transformed statements into the output graph. - for subj, pred_objs in grouped_statements.items(): - if subj not in old_subjs: - transformed_statements[subj] = pred_objs - - return rdftools.ungroup_statements(transformed_statements) - - -# Represents a standoff tag to be be transformed. -class StandoffTag: - def __init__(self, old_subj, pred_objs): - self.old_subj = old_subj - self.pred_objs = pred_objs - self.start_index = int(pred_objs[standoff_tag_has_start_index][0]) - self.new_subj = make_new_standoff_tag_iri(old_subj, self.start_index) - - # Transforms the statements whose subject is this text value. - def transform_pred_objs(self, standoff_tags): - transformed_pred_objs = {} - - for pred, objs in self.pred_objs.items(): - if pred == standoff_tag_has_start_parent or pred == standoff_tag_has_end_parent: - old_obj = objs[0] - new_obj = standoff_tags[old_obj].new_subj - transformed_pred_objs[pred] = [new_obj] - else: - transformed_pred_objs[pred] = objs - - return transformed_pred_objs - - -# Converts an old standoff tag IRI to a new one. -def make_new_standoff_tag_iri(old_subj, start_index): - old_subj_str = str(old_subj) - slash_pos = old_subj_str.rfind("/") + 1 - return rdflib.term.URIRef(old_subj_str[0:slash_pos] + str(start_index)) - - -# Represents a text value to be transformed. -class TextValue: - def __init__(self, subj, pred_objs, standoff_tags): - self.subj = subj - self.pred_objs = pred_objs - self.standoff_tags = standoff_tags - - # Transforms the statements whose subject is this text value or any of its standoff tags. - def transform_statements(self): - transformed_value_pred_objs = {} - - for pred, objs in self.pred_objs.items(): - if pred == value_has_standoff: - new_objs = [] - - for old_obj in objs: - new_objs.append(self.standoff_tags[old_obj].new_subj) - - transformed_value_pred_objs[pred] = new_objs - else: - transformed_value_pred_objs[pred] = objs - - if self.standoff_tags: - max_start_index = max([tag.start_index for tag in self.standoff_tags.values()]) - max_start_index_literal = rdflib.Literal(str(max_start_index), datatype=XSD.integer) - transformed_value_pred_objs[value_has_max_standoff_start_index] = [max_start_index_literal] - - transformed_statements = { - self.subj: transformed_value_pred_objs - } - - for tag in self.standoff_tags.values(): - transformed_statements[tag.new_subj] = tag.transform_pred_objs(self.standoff_tags) - - return transformed_statements - - -# Collects all text values found in grouped statements. -def collect_text_values(grouped_statements): - text_values = [] - - for subj, pred_objs in grouped_statements.items(): - if pred_objs[RDF.type][0] == text_value_type: - standoff_tags = {} - - if value_has_standoff in pred_objs: - standoff_subjs = pred_objs[value_has_standoff] - - for standoff_subj in standoff_subjs: - standoff_pred_objs = grouped_statements[standoff_subj] - standoff_tag = StandoffTag(old_subj=standoff_subj, pred_objs=standoff_pred_objs) - standoff_tags[standoff_subj] = standoff_tag - - text_values.append(TextValue(subj=subj, pred_objs=pred_objs, standoff_tags=standoff_tags)) - - return text_values diff --git a/upgrade/plugins/pr1322/knora-ontologies/knora-admin.ttl b/upgrade/plugins/pr1322/knora-ontologies/knora-admin.ttl deleted file mode 100644 index 68df980d37..0000000000 --- a/upgrade/plugins/pr1322/knora-ontologies/knora-admin.ttl +++ /dev/null @@ -1,773 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix knora-base: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xml: . -@prefix xsd: . -@prefix foaf: . -@prefix dcterms: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The Knora admin ontology"@en ; - - knora-base:attachedToProject :SystemProject . - - -################################################################# -# -# Object Properties -# -################################################################# - - - -### http://www.knora.org/ontology/knora-admin#belongsToInstitution - -:belongsToInstitution rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates which Institution a knoraProject belongs to"@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectClassConstraint :Institution . - - - -### http://www.knora.org/ontology/knora-admin#belongsToProject - -:belongsToProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates which knoraProject a UserGroup belongs to"@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#currentproject - -:currentproject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "This property indicates, which is the \"current project\" of a given user. A user can be part of any number of projects, but only one can be the active project."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#isInGroup - -:isInGroup rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given User is part of the given UserGroup"@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :UserGroup . - - - -### http://www.knora.org/ontology/knora-admin#isInProject - -:isInProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given User is part of the given knoraProject"@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#isAdminForProject - -:isInProjectAdminGroup rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given User is part of the given Project's ProjectAdmin group"@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -################################################################# -# -# Datatype properties -# -################################################################# - - -### http://www.knora.org/ontology/knora-admin#address - -:address rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - knora-base:objectDatatypeConstraint xsd:string ; - - rdfs:comment "Address of a person or an institution"@en . - - -### http://www.knora.org/ontology/knora-admin#groupName - -:groupName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The group's name"@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectDatatypeConstraint xsd:string ; - - rdfs:subPropertyOf . - - - -### http://www.knora.org/ontology/knora-admin#groupDescription - -:groupDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of a user group"@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#hasSelfJoinEnabled - -:hasSelfJoinEnabled rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if users can add themselves to the project or group"@en ; - - # No knora-base:subjectClassConstraint, because this can be used with :knoraProject or :UserGroup. - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-admin#institutionName - -:institutionName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The institutions's name"@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#institutionDescription - -:institutionDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of an institution"@en ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#institutionWebsite - -:institutionWebsite rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The URL of a web site"@en ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:anyURI . - - - -### http://www.knora.org/ontology/knora-admin#isActiveUser - -:isInSystemAdminGroup rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if the user is a member of the SystemAdmin group."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-admin#givenName - -:givenName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf foaf:givenName, :objectCannotBeMarkedAsDeleted ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#familyName - -:familyName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf foaf:familyName, :objectCannotBeMarkedAsDeleted ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#password - -:password rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "An encrypted credential for access"@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#phone - -:phone rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Phone number of a person, institution, etc."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#preferredLanguage - -:preferredLanguage rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Language (\"en\", \"de\", \"fr\", \"it\", \"gr\", etc.)"@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectDescription - -:projectDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of a Knora project"@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectKeyword - -:projectKeyword rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A keyword describing a project"@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectLongname - -:projectLongname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The longname of a Knora project"@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectLogo - -:projectLogo rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Path to the projects logo"@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectRestrictedViewSize - -:projectRestrictedViewSize rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The size of the image (as defined by IIIF) returned for restricted view"@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectRestrictedViewWatermark - -:projectRestrictedViewWatermark rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Path to the restricted view watermark"@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectShortname - -:projectShortname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The unique shortname of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectShortcode - -:projectShortcode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The unique short code of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#username - -:username rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The username and login name of a user of Knora"@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#email - -:email rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The email address and login name of a user of Knora"@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#status - -:status rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The status of the user / group / project. It is false if the entity has been deactivated (deleted)"@en ; - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -################################################################# -# -# Classes -# -################################################################# - - - -### http://www.knora.org/ontology/knora-admin#Institution - -:Institution rdf:type owl:Class ; - - rdfs:subClassOf foaf:Organization , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionDescription ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionWebsite ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :phone ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :address ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :email ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "An institution that has data in Knora"@en . - - - -### http://www.knora.org/ontology/knora-admin#User - -:User rdf:type owl:Class ; - - rdfs:subClassOf foaf:Person , - [ rdf:type owl:Restriction ; - owl:onProperty :username ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :email ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :familyName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :givenName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :password ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :preferredLanguage ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInProject ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInGroup ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInSystemAdminGroup ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a Knora user"@en . - - - -### http://www.knora.org/ontology/knora-admin#UserGroup - -:UserGroup rdf:type owl:Class ; - - rdfs:subClassOf foaf:Group , - [ rdf:type owl:Restriction ; - owl:onProperty :groupName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :groupDescription ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :belongsToProject ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:comment "A group of Knora users"@en . - - - - -### http://www.knora.org/ontology/knora-admin#knoraProject - -:knoraProject rdf:type owl:Class ; - - rdfs:subClassOf foaf:Project , - [ rdf:type owl:Restriction ; - owl:onProperty :projectShortname ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectShortcode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectLongname ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectDescription ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectKeyword ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectLogo ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectRestrictedViewSize ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectRestrictedViewWatermark ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :belongsToInstitution ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasSelfJoinEnabled ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a project that uses Knora"@en . - - - - -################################################################# -# -# Individuals -# -################################################################# - -### http://www.knora.org/ontology/knora-admin#UnknownUser -:UnknownUser rdf:type :UserGroup ; - :groupName "UnknownUser" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#KnownUser -:KnownUser rdf:type :UserGroup ; - :groupName "KnownUser" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#Creator -:Creator rdf:type :UserGroup ; - :groupName "Creator" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#ProjectMember -:ProjectMember rdf:type :UserGroup ; - :groupName "ProjectMember" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#ProjectAdmin -:ProjectAdmin rdf:type :UserGroup ; - :groupName "ProjectAdmin" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemAdmin -:SystemAdmin rdf:type :UserGroup ; - :groupName "SystemAdmin" ; - :belongsToProject :SystemProject ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemUser -:SystemUser rdf:type :User ; - rdfs:comment "A built-in system user."@en ; - :username "system"; - :email "system@localhost" ; - :givenName "Knora" ; - :familyName "System" ; - :password "-" ; - :status "true"^^xsd:boolean ; - :preferredLanguage "en" ; - :isInSystemAdminGroup "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#AnonymousUser -:AnonymousUser rdf:type :User ; - rdfs:comment "A built-in anonymous user."@en ; - :username "anonymous" ; - :email "anonymous@localhost" ; - :givenName "Knora" ; - :familyName "Anonymous" ; - :password "-" ; - :status "true"^^xsd:boolean ; - :preferredLanguage "en" ; - :isInSystemAdminGroup "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemProject -:SystemProject rdf:type :knoraProject ; - rdfs:comment "A built-in project representing the Knora System."@en ; - :projectShortname "SystemProject" ; - :projectShortcode "FFFF" ; - :projectLongname "Knora System Project" ; - :projectDescription "Knora System Project"@en ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - - -### http://www.knora.org/ontology/knora-admin#SharedOntologiesProject -:DefaultSharedOntologiesProject rdf:type :knoraProject ; - rdfs:comment "The default project for shared ontologies."@en ; - :projectShortname "DefaultSharedOntologiesProject" ; - :projectShortcode "0000" ; - :projectLongname "Knora Default Shared Ontologies Project" ; - :projectDescription "Knora Shared Ontologies Project"@en ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - -# -## -### Permission Class Properties -## -# -### http://www.knora.org/ontology/knora-admin#forProject - -:forProject rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a knoraProject."@en ; - knora-base:subjectClassConstraint :Permission ; - knora-base:objectClassConstraint :knoraProject . - -### http://www.knora.org/ontology/knora-admin#forGroup -:forGroup rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a UserGroup."@en ; - knora-base:subjectClassConstraint :Permission ; - knora-base:objectClassConstraint :UserGroup . - -### http://www.knora.org/ontology/knora-admin#forResourceClass -:forResourceClass rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a resource class."@en ; - knora-base:subjectClassConstraint :Permission . - -### http://www.knora.org/ontology/knora-admin#forProperty -:forProperty rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a resource property."@en ; - knora-base:subjectClassConstraint :Permission . - - -# -## -### Permission Class and Sub-Classes -## -# -### http://www.knora.org/ontology/knora-admin#Permission -:Permission rdf:type owl:Class ; - rdfs:comment "Base Permission class."@en. - - -### http://www.knora.org/ontology/knora-admin#AdministrativePermission -:AdministrativePermission rdf:type owl:Class ; - rdfs:comment "Administrative Permission class used to create instances for storing administrative permissions on groups."@en ; - rdfs:subClassOf :Permission . - -### http://www.knora.org/ontology/knora-admin#DefaultObjectAccessPermission -:DefaultObjectAccessPermission rdf:type owl:Class ; - rdfs:comment "Default Object Access Permission class used to create instances for storing default object access permission for a project and either groups, resource classes, or properties."@en ; - rdfs:subClassOf :Permission . diff --git a/upgrade/plugins/pr1322/knora-ontologies/knora-base.ttl b/upgrade/plugins/pr1322/knora-ontologies/knora-base.ttl deleted file mode 100644 index 8c2054e7a7..0000000000 --- a/upgrade/plugins/pr1322/knora-ontologies/knora-base.ttl +++ /dev/null @@ -1,2709 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xml: . -@prefix xsd: . -@prefix foaf: . -@prefix dcterms: . -@prefix salsah-gui: . -@prefix knora-admin: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The Knora base ontology"@en ; - - :attachedToProject knora-admin:SystemProject ; - - :ontologyVersion "PR 1322" . - - - -################################################################# -# -# Properties -# -################################################################# - - - -### http://www.knora.org/ontology/knora-base#ontologyVersion - -:ontologyVersion rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates the version of the Knora built-in ontologies in a repository."@en ; - - :subjectClassConstraint owl:Ontology ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#isMainResource - -# This property is generated by a SPARQL CONSTRUCT query, it is not used in the triplestore and not used in the API - -:isMainResource rdf:type owl:DatatypeProperty ; - - rdfs:comment "Indicates if the given resource is the main resource of a request or a resource referred to by a link property."@en; - - :subjectClassConstraint :Resource ; - - :objectDatatypeConstraint xsd:boolean . - - -### http://www.knora.org/ontology/knora-base#objectCannotBeMarkedAsDeleted - -:objectCannotBeMarkedAsDeleted rdf:type rdf:Property ; - - rdfs:comment "The base property of properties whose objects can't be marked as deleted"@en . - - - -### http://www.knora.org/ontology/knora-base#objectDatatypeConstraint - -:objectDatatypeConstraint rdf:type owl:DatatypeProperty ; - - rdfs:comment "Specifies the type required as the object of a datatype property"@en . - - - -### http://www.knora.org/ontology/knora-base#resourceIcon - -:resourceIcon rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint owl:Class ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#resourceProperty - -:resourceProperty rdf:type owl:ObjectProperty ; - - rdfs:comment "The base property of properties that point from Knora resources to Knora resources or values. These properties are required to have cardinalities in the resource classes in which they are used."@en ; - - :subjectClassConstraint :Resource . - - - -### http://www.knora.org/ontology/knora-base#subjectClassConstraint - -:subjectClassConstraint rdf:type owl:ObjectProperty ; - - rdfs:comment "Specifies the OWL class that the subject of a property must belong to"@en . - - - -### http://www.knora.org/ontology/knora-base#objectClassConstraint - -:objectClassConstraint rdf:type owl:ObjectProperty ; - - rdfs:comment "Specifies the OWL class that the object of a property must belong to"@en . - - - -### http://www.knora.org/ontology/knora-base#isEditable - -:isEditable rdf:type owl:AnnotationProperty ; - - :objectDatatypeConstraint xsd:boolean ; - - rdfs:label "is editable"@en ; - - rdfs:comment "Indicates whether a property's values can be updated via the Knora API."@en . - - - -### http://www.knora.org/ontology/knora-base#canBeInstantiated - -:canBeInstantiated rdf:type owl:AnnotationProperty ; - - :subjectClassConstraint owl:Class ; - - :objectDatatypeConstraint xsd:boolean ; - - rdfs:label "can be instantiated"@en ; - - rdfs:comment "Indicates whether a resource class can be instantiated via the Knora API."@en . - - - -### http://www.knora.org/ontology/knora-base#attachedToProject - -:attachedToProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "attached to project"@en ; - - rdfs:comment "Connects something to a project"@en ; - - :objectClassConstraint knora-admin:knoraProject . - - - -### http://www.knora.org/ontology/knora-base#attachedToUser - -:attachedToUser rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "attached to user"@en ; - - rdfs:comment "Connects something to a user"@en ; - - :objectClassConstraint knora-admin:User . - - -### http://www.knora.org/ontology/knora-base#hasColor - -:hasColor rdf:type owl:ObjectProperty ; - - rdfs:label "Farbe"@de , - "Color"@en , - "Couleur"@fr , - "Colore"@it ; - - rdfs:comment """Specifies the color of a region."""@en ; - - salsah-gui:guiAttribute "ncolors=8"^^xsd:string ; - - :objectClassConstraint :ColorValue ; - - :subjectClassConstraint :Region ; - - rdfs:subPropertyOf :hasValue ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Colorpicker . - - - -### http://www.knora.org/ontology/knora-base#hasComment - -:hasComment rdf:type owl:ObjectProperty ; - - rdfs:label "Kommentar"@de , - "Comment"@en , - "Commentaire"@fr , - "Commento"@it ; - - rdfs:comment """Represents a comment on a resource as a knora-base:TextValue"""@de ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :TextValue ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Richtext ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasExtResValue - -:hasExtResValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat externen Wert"@de , - "has external Value"@en , - "a valeur externe"@fr , - "ha valore esterno"@it ; - - :objectClassConstraint :ExternalResValue ; - - :subjectClassConstraint :ExternalResource ; - - rdfs:subPropertyOf :hasValue . - - -### http://www.knora.org/ontology/knora-base#hasFileValue - -:hasFileValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :FileValue ; - - rdfs:label "hat Datei"@de , - "has file"@en , - "a fichier"@fr , - "ha file"@it ; - - rdfs:comment "Connects a Representation to a file"@en ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - :subjectClassConstraint :Representation ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasStillImageFileValue - -:hasStillImageFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Bilddatei"@de , - "has image file"@en , - "a fichier d'image"@fr , - "ha file imagine"@it ; - - rdfs:comment "Connects a Representation to an image file"@en ; - - :objectClassConstraint :StillImageFileValue ; - - :subjectClassConstraint :StillImageRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasMovingImageFileValue - -:hasMovingImageFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Filmdatei"@de , - "has movie file"@en , - "a fichier de film"@fr , - "ha file film"@it ; - - rdfs:comment "Connects a Representation to a movie file"@en ; - - :objectClassConstraint :MovingImageFileValue ; - - :subjectClassConstraint :MovingImageRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasAudioFileValue - -:hasAudioFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Audiodatei"@de , - "has audio file"@en , - "a fichier d'audio"@fr , - "ha file audio"@it ; - - rdfs:comment "Connects a Representation to an audio file"@en ; - - :objectClassConstraint :AudioFileValue ; - - :subjectClassConstraint :AudioRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasDDDFileValue - -:hasDDDFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat 3D-Datei"@de , - "has 3D-file"@en , - "a ficher de 3D"@fr , - "ha file 3D"@it ; - - rdfs:comment "Connects a Representation to a 3D-file"@en ; - - :objectClassConstraint :DDDFileValue ; - - :subjectClassConstraint :DDDRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasTextFileValue - -:hasTextFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Textdatei"@de , - "has text file"@en , - "a fichier de texte"@fr , - "ha file testo"@it ; - - rdfs:comment "Connects a Representation to a text file"@en ; - - :objectClassConstraint :TextFileValue ; - - :subjectClassConstraint :TextRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasDocumentFileValue - -:hasDocumentFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Dokument"@de , - "has document"@en , - "a document"@fr , - "ha documento"@it ; - - rdfs:comment "Connects a Representation to a document"@en ; - - :objectClassConstraint :DocumentFileValue ; - - :subjectClassConstraint :DocumentRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasGeometry - -:hasGeometry rdf:type owl:ObjectProperty ; - - rdfs:label "Geometrie"@de , - "Geometry"@en , - "Géometrie"@fr , - "Geometria"@it ; - - rdfs:comment """Represents a geometrical shape."""@en ; - - rdfs:subPropertyOf :hasValue ; - - salsah-gui:guiElement salsah-gui:Geometry ; - - :isEditable true ; - - :objectClassConstraint :GeomValue ; - - :subjectClassConstraint :Region . - - - -### http://www.knora.org/ontology/knora-base#hasLinkTo - -:hasLinkTo rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :resourceProperty ; - - rdfs:label "hat Link zu"@de , - "has Link to"@en , - "a lien vers"@fr , - "ha Link verso"@it ; - - rdfs:comment "Represents a direct connection between two resources"@en ; - - :isEditable true ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :Resource . - - - -### http://www.knora.org/ontology/knora-base#hasLinkToValue - -:hasLinkToValue rdf:type owl:ObjectProperty ; - - rdfs:comment "Points to a LinkValue reification describing a link between two resources"@en ; - - rdfs:label "hat Link zu"@de , - "has Link to"@en , - "a lien vers"@fr , - "ha Link verso"@it ; - - rdfs:comment "Represents a direct connection between two resources"@en ; - - :isEditable true ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasRepresentation - -:hasRepresentation rdf:type owl:ObjectProperty ; - - rdfs:label "hat Repräsentation"@de , - "has Representation"@en , - "a Répresentation"@fr , - "ha Rappresentazione"@it ; - - rdfs:comment "References an instance of a Representation. A Representation contains the metadata of a digital object (= file) which represents some physical entity such as an image, a sound, an encoded text etc."@en ; - - :objectClassConstraint :Representation ; - - :subjectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#hasRepresentationValue - -:hasRepresentationValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - - -### http://www.knora.org/ontology/knora-base#hasStandoffLinkTo - -:hasStandoffLinkTo rdf:type owl:ObjectProperty ; - - rdfs:label "hat Standoff Link zu"@de , - "has Standoff Link to"@en , - "a standoff lien vers"@fr , - "ha standoff link verso"@it ; - - rdfs:comment "Repräsentiert einen Link im Standoff Markup von einer Ressource zu einer anderen"@de , - "Represents a link in standoff markup from one resource to another."@en ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#hasStandoffLinkToValue - -:hasStandoffLinkToValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Standoff Link zu"@de , - "has Standoff Link to"@en , - "a standoff lien vers"@fr , - "ha standoff link verso"@it ; - - rdfs:comment "Repräsentiert einen Link im Standoff Markup von einer Ressource zu einer anderen"@de , - "Represents a link in standoff markup from one resource to another."@en ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#standoffTagHasLink - -:standoffTagHasLink rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :StandoffLinkTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasInternalReference - -:standoffTagHasInternalReference rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :StandoffTag ; - - :subjectClassConstraint :StandoffInternalReferenceTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStart - -:standoffTagHasStart rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEnd - -:standoffTagHasEnd rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartIndex - -:standoffTagHasStartIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEndIndex - -:standoffTagHasEndIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartAncestor - -:standoffTagHasStartAncestor rdf:type owl:ObjectProperty, owl:TransitiveProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartParent - -:standoffTagHasStartParent rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted, :standoffTagHasStartAncestor ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEndParent - -:standoffTagHasEndParent rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasUUID - -:standoffTagHasUUID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:string . - - -:valueHasMaxStandoffStartIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#hasSubListNode - -:hasSubListNode rdf:type owl:ObjectProperty ; - - rdfs:comment "A hierarchical list is formed using the \"hasSubListNode\"-property"@en ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :ListNode ; - - :subjectClassConstraint :ListNode . - - -### http://www.knora.org/ontology/knora-base#hasValue - -:hasValue rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :resourceProperty ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :Value . - - -### http://www.knora.org/ontology/knora-base#isAnnotationOf - -:isAnnotationOf rdf:type owl:ObjectProperty ; - - rdfs:label "ist Annotation von"@de , - "is Annotation of"@en , - "est Annotation de"@fr , - "è Annotation di"@it ; - - :subjectClassConstraint :Annotation ; - - :objectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isAnnotationOfValue - -:isAnnotationOfValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Annotation ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#isPartOf - -:isPartOf rdf:type owl:ObjectProperty ; - - rdfs:label "ist Teil von"@de , - "is part of"@en , - "fait partie de"@fr , - "fa parte di"@it ; - - rdfs:comment "Indicates that this resource is part of another resource"@en ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isPartOfValue - -:isPartOfValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#isRegionOf - -:isRegionOf rdf:type owl:ObjectProperty ; - - rdfs:comment "Region of interest within a digital object (e.g. an image)"@en ; - - rdfs:label "is Region von"@de , - "is region of"@en , - "est région de"@fr , - "è regione di"@it ; - - :subjectClassConstraint :Region ; - - :objectClassConstraint :Representation ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isRegionOfValue - -:isRegionOfValue rdf:type owl:ObjectProperty ; - - rdfs:comment "Region of interest within a digital object (e.g. an image)"@en ; - - rdfs:label "is Region von"@de , - "is region of"@en , - "est région de"@fr , - "è regione di"@it ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Region ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#previousValue - -:previousValue rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "Points to the previous verson of a value"@en ; - - :subjectClassConstraint :Value ; - - :objectClassConstraint :Value . - - - -### http://www.knora.org/ontology/knora-base#seqnum - -:seqnum rdf:type owl:ObjectProperty ; - - :objectClassConstraint :IntValue ; - - rdfs:subPropertyOf :hasValue ; - - rdfs:label "Sequenznummer"@de , - "Sequence number"@en , - "Numéro de séquence"@fr , - "Numero di sequenza"@it ; - - rdfs:comment "Indicates the position of a resource within a sequence"@en . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasOriginalXMLID - -:standoffTagHasOriginalXMLID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:string ; - - :subjectClassConstraint :StandoffTag . - - - -### http://www.knora.org/ontology/knora-base#valueHasStandoff - -:valueHasStandoff rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :objectClassConstraint :StandoffTag ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#valueHasLanguage - -:valueHasLanguage rdf:type owl:DatatypeProperty ; - - :objectDatatypeConstraint xsd:string ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#valueHasMapping - -:valueHasMapping rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :objectClassConstraint :XMLToStandoffMapping ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#hasMappingElement - -:hasMappingElement rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "mapping element"@en ; - - rdfs:comment """Represents an element in a mapping"""@en ; - - :subjectClassConstraint :XMLToStandoffMapping ; - - :objectClassConstraint :MappingElement . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLTagname - -:mappingHasXMLTagname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML tag"@en ; - - rdfs:comment """name of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLNamespace - -:mappingHasXMLNamespace rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "namespace of the XML tag"@en ; - - rdfs:comment """namespace of the XML tag"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLClass - -:mappingHasXMLClass rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "class of the XML tag"@en ; - - rdfs:comment """class of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffClass - -:mappingHasStandoffClass rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "IRI of the standoff class"@en ; - - rdfs:comment """IRI of the standoff class"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectClassConstraint owl:Class . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLAttribute - -:mappingHasXMLAttribute rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML attribute"@en ; - - rdfs:comment """name of the XML attribute"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectClassConstraint :MappingXMLAttribute . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLAttributename - -:mappingHasXMLAttributename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML attribute"@en ; - - rdfs:comment """name of the XML attribute"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffProperty - -:mappingHasStandoffProperty rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "IRI of the standoff property"@en ; - - rdfs:comment """IRI of the standoff property"""@en ; - - :subjectClassConstraint :MappingXMLAttribute . - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffDataTypeClass - -:mappingHasStandoffDataTypeClass rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "datatype of the XML tag"@en ; - - rdfs:comment """datatype of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectClassConstraint :MappingStandoffDataTypeClass . - - -### http://www.knora.org/ontology/knora-base#mappingElementRequiresSeparator - -:mappingElementRequiresSeparator rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "indicates if the element requires a separator in the text"@en ; - - rdfs:comment """indicates if the element requires a separator in the text"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:boolean . - - -### http://www.knora.org/ontology/knora-base#mappingHasDefaultXSLTransformation - -:mappingHasDefaultXSLTransformation rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "default XSL Transformation"@en ; - - rdfs:comment """default XSL Transformation for this mapping"""@en ; - - :subjectClassConstraint :XMLToStandoffMapping ; - - :objectClassConstraint :XSLTransformation . - - -### http://www.knora.org/ontology/knora-base#deletedBy - -:deletedBy rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates who deleted a resource or value"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectClassConstraint knora-admin:User . - - -################################################################# -# -# Datatype properties -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#creationDate - -:creationDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates when a resource was created"@en ; - - :subjectClassConstraint :Resource ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#deleteDate - -:deleteDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates when a resource or value was deleted"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:dateTime . - - -### http://www.knora.org/ontology/knora-base#dimX - -:dimX rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :FileValue ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#dimY - -:dimY rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :FileValue ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#duration - -:duration rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#extResAccessInfo - -:extResAccessInfo rdf:type owl:DatatypeProperty ; - - rdfs:comment "Information (URL etc.) for accessing an external resource"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#extResId - -:extResId rdf:type owl:DatatypeProperty ; - - rdfs:comment "The ID of the external resource. The form of the ID is dependent on the provider."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#extResProvider - -:extResProvider rdf:type owl:DatatypeProperty ; - - rdfs:comment "The name of the external provider of the resource"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - - -### http://www.knora.org/ontology/knora-base#fps - -:fps rdf:type owl:DatatypeProperty ; - - rdfs:label "Frames per second"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :MovingImageFileValue ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#internalFilename - -:internalFilename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#internalMimeType - -:internalMimeType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#isDeleted - -:isDeleted rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if the resource has been deleted"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#isRootNode - -:isRootNode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#hasRootNode - -:hasRootNode rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint :ListNode . - - - - -### http://www.knora.org/ontology/knora-base#lastModificationDate - -:lastModificationDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#listNodePosition - -:listNodePosition rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#listNodeName - -:listNodeName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#originalFilename - -:originalFilename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#originalMimeType - -:originalMimeType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasComment - -:valueHasComment rdf:type owl:DatatypeProperty ; - - rdfs:comment "A comment on a value"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#deleteComment - -:deleteComment rdf:type owl:DatatypeProperty ; - - rdfs:comment "A comment explaining why a resource or value was marked as deleted"@en ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueCreationDate - -:valueCreationDate rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :Value ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#valueHas - -:valueHas rdf:type rdf:Property ; - - :subjectClassConstraint :ValueBase ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted . - - - -### http://www.knora.org/ontology/knora-base#valueHasUUID - -:valueHasUUID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "The UUID of a value"@en ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasCalendar - -:valueHasCalendar rdf:type owl:DatatypeProperty ; - - rdfs:comment "Name of the calendar to be used, such as \"GREGORIAN\" or \"JULIAN\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasColor - -:valueHasColor rdf:type owl:DatatypeProperty ; - - rdfs:comment "Color in the form of #rrggbb (as defining web colors)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ColorBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasEndJDN - -:valueHasEndJDN rdf:type owl:DatatypeProperty ; - - rdfs:comment "Contains the end of a date as a Julian Day Number (JDN)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasEndPrecision - -:valueHasEndPrecision rdf:type owl:DatatypeProperty ; - - rdfs:comment "Precision of knowledge about the end of the date. Allowed are \"DAY\", \"MONTH\" or \"YEAR\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasDecimal - -:valueHasDecimal rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DecimalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasGeometry - -:valueHasGeometry rdf:type owl:DatatypeProperty ; - - rdfs:comment "JSON string describing a geometry (e.g. a region). Currently geometries are limited to 2D unions of primitive objects like circles, squares and polygons."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :GeomValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasGeonameCode - -:valueHasGeonameCode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :GeonameValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasInteger - -:valueHasInteger rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasBoolean - -:valueHasBoolean rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :BooleanBase ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#valueHasUri - -:valueHasUri rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :UriBase ; - - :objectDatatypeConstraint xsd:anyURI . - - - -### http://www.knora.org/ontology/knora-base#valueHasIntervalEnd - -:valueHasIntervalEnd rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntervalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasIntervalStart - -:valueHasIntervalStart rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntervalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasListNode - -:valueHasListNode rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ListValue ; - - :objectClassConstraint :ListNode . - - - -### http://www.knora.org/ontology/knora-base#valueHasOrder - -:valueHasOrder rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#valueHasRefCount - -:valueHasRefCount rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :LinkValue ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasStartJDN - -:valueHasStartJDN rdf:type owl:DatatypeProperty ; - - rdfs:comment "Contains the start of a date as a Julian Day Number (JDN)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasStartPrecision - -:valueHasStartPrecision rdf:type owl:DatatypeProperty ; - - rdfs:comment "The precision the start of a date. Allowed values are \"DAY\", \"MONTH\", or \"YEAR\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasString - -:valueHasString rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "A string representation of a value, required for full-text searches and search results."@en ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#hasPermissions - -:hasPermissions rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:string . - - - -################################################################# -# -# Classes -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#Annotation - -:Annotation rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isAnnotationOf ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isAnnotationOfValue ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Annotation"@de , - "Annotation"@en , - "Annotation"@fr , - "Annotation"@it ; - - :canBeInstantiated true ; - - rdfs:comment "A generic class for representing annotations"@en . - - - -### http://www.knora.org/ontology/knora-base#AudioFileValue - -:AudioFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :duration ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents an audio file"@en . - - - -### http://www.knora.org/ontology/knora-base#AudioRepresentation - -:AudioRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasAudioFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Audio)"@de , - "Representation (Audio)"@en , - "Répresentation (Audio)"@fr , - "Rappresentazione (Audio)"@it ; - - rdfs:comment "Represents a file containing audio data"@en . - - -### http://www.knora.org/ontology/knora-base#ColorBase - -:ColorBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasColor ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#ColorValue - -:ColorValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :ColorBase ; - - rdfs:comment "Represents a color in HTML format, e.g. \"#33eeff\""@en . - - - -### http://www.knora.org/ontology/knora-base#DDDFileValue - -:DDDFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue ; - - rdfs:comment "This represents some 3D-object with mesh data, point cloud, etc."@en . - - - -### http://www.knora.org/ontology/knora-base#DDDRepresentation - -:DDDRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasDDDFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (3D)"@de , - "Representation (3D)"@en , - "Répresentation (3D)"@fr , - "Rappresentazione (3D)"@it ; - - rdfs:comment "Represents a file containg 3D data"@en . - - -### http://www.knora.org/ontology/knora-base#DateBase - -:DateBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasCalendar ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasEndPrecision ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasEndJDN ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStartPrecision ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStartJDN ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#DateValue - -:DateValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :DateBase ; - - rdfs:comment "Represents a Knora date value"@en . - - - -### http://www.knora.org/ontology/knora-base#DocumentFileValue - -:DocumentFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue . - - - -### http://www.knora.org/ontology/knora-base#DocumentRepresentation - -:DocumentRepresentation rdf:type owl:Class ; - - rdfs:label "Repräsentation (Dokument)"@de , - "Representation (Document)"@en , - "Répresentation (Document)"@fr , - "Rappresentazione (Documento)"@it ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasDocumentFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ExternalResValue - -:ExternalResValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :extResId ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :extResProvider ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :extResAccessInfo ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ExternalResource - -:ExternalResource rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasExtResValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Externe Ressource"@de , - "External Resource"@en , - "Ressource Externe"@fr , - "Risorsa esterna"@it ; - - rdfs:comment "Represents a proxy for an object stored by an external provider"@en . - - - -### http://www.knora.org/ontology/knora-base#FileValue - -:FileValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :originalMimeType ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :internalFilename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :internalMimeType ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :originalFilename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#DecimalBase - -:DecimalBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasDecimal ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#DecimalValue - -:DecimalValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :DecimalBase ; - - rdfs:comment "Represents an arbitrary-precision decimal value"@en . - - - -### http://www.knora.org/ontology/knora-base#GeomValue - -:GeomValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasGeometry ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a geometrical objects as JSON string"@en . - - - -### http://www.knora.org/ontology/knora-base#GeonameValue - -:GeonameValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasGeonameCode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#IntBase - -:IntBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasInteger ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#IntValue - -:IntValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :IntBase ; - - rdfs:comment "Represents an integer value"@en . - -### http://www.knora.org/ontology/knora-base#BooleanBase - -:BooleanBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasBoolean ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#BooleanValue - -:BooleanValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :BooleanBase ; - - rdfs:comment "Represents a boolean value"@en . - - - -### http://www.knora.org/ontology/knora-base#UriBase - -:UriBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasUri ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - -### http://www.knora.org/ontology/knora-base#UriValue - -:UriValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :UriBase ; - - rdfs:comment "Represents a URI"@en . - -### http://www.knora.org/ontology/knora-base#IntervalBase - -:IntervalBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasIntervalEnd ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasIntervalStart ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#IntervalValue - -:IntervalValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :IntervalBase ; - - rdfs:comment "Represents a time interval, e.g. in an audio recording"@en . - - - -### http://www.knora.org/ontology/knora-base#LinkObj - -:LinkObj rdf:type owl:Class ; - - rdfs:label "Verknüpfungsobjekt"@de , - "Link Object"@en , - "Objet de lien"@fr , - "Oggetto di connessione"@it ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasLinkTo ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasLinkToValue ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - :resourceIcon "link.gif"^^xsd:string ; - - :canBeInstantiated true ; - - rdfs:comment "Verknüpfung mehrerer Resourcen"@de , - "Represents a generic link object"@en . - - - -### http://www.knora.org/ontology/knora-base#LinkValue - -:LinkValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - rdf:Statement , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasRefCount ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:subject ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:predicate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:object ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "A reification node that describes direct links between resources"@en . - - - -### http://www.knora.org/ontology/knora-base#ListNode - -:ListNode rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :hasSubListNode ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :listNodePosition ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :listNodeName ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRootNode ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasRootNode ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToProject ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdfs:label ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:comment "Represents a flat or hierarchical list"@en . - - - -### http://www.knora.org/ontology/knora-base#ListValue - -:ListValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasListNode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#MovingImageFileValue - -:MovingImageFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :dimX ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :dimY ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :fps ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :duration ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a moving image file"@en . - - - -### http://www.knora.org/ontology/knora-base#MovingImageRepresentation - -:MovingImageRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasMovingImageFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Video)"@de , - "Representation (Movie)"@en , - "Répresentation (Film)"@fr , - "Rappresentazione (Film)"@it ; - - rdfs:comment "A resource containing moving image data"@en . - - - -### http://www.knora.org/ontology/knora-base#Region - -:Region rdf:type owl:Class ; - - rdfs:label "Region"@de , - "Region"@en , - "Région"@fr , - "Regione"@it ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasColor ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRegionOf ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasGeometry ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRegionOfValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - :resourceIcon "region.gif"^^xsd:string ; - - :canBeInstantiated true ; - - rdfs:comment "Represents a geometric region of a resource. The geometry is represented currently as JSON string."@en . - - - -### http://www.knora.org/ontology/knora-base#Representation - -:Representation rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation"@de , - "Representation"@en , - "Répresentation"@fr , - "Rappresentazione"@it ; - - rdfs:comment "A resource that can store a file"@en . - - - -### http://www.knora.org/ontology/knora-base#Resource - -:Resource rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty rdfs:label ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isDeleted ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStandoffLinkTo ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStandoffLinkToValue ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToUser ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToProject ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasPermissions ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :creationDate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :lastModificationDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deletedBy ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Ressource"@de , - "Resource"@en , - "Ressource"@fr , - "Risorsa"@it ; - - rdfs:comment "Represents something in the world, or an abstract thing"@en . - - -################################################################# -# -# Generic Standoff Tag -# -################################################################# - - -:standoffParentClassConstraint rdf:type owl:ObjectProperty . - - -### http://www.knora.org/ontology/knora-base#StandoffTag - -:StandoffTag rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStart ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEnd ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasUUID ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasOriginalXMLID ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStartIndex ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEndIndex ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStartParent ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEndParent ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffParentClassConstraint; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a standoff markup tag"@en . - - - -################################################################# -# -# Abstract Standoff Data Type Tag -# -################################################################# - -### http://www.knora.org/ontology/knora-base#StandoffDataTypeTag - -:StandoffDataTypeTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffTag ; - - rdfs:comment "Represents a knora-base value type in a TextValue"@en . - - -################################################################# -# -# Standoff Data Type Tags that can be instantiated -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#StandoffLinkTag - -:StandoffLinkTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasLink ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a reference to a Knora resource in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffUriTag - -:StandoffUriTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag , - :UriBase ; - - rdfs:comment "Represents an arbitrary URI in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffDateTag - -:StandoffDateTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :DateBase ; - - rdfs:comment "Represents a date in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffColorTag - -:StandoffColorTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :ColorBase ; - - rdfs:comment "Represents a color in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffIntegerTag - -:StandoffIntegerTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :IntBase ; - - rdfs:comment "Represents an integer value in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffDecimalTag - -:StandoffDecimalTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :DecimalBase ; - - rdfs:comment "Represents a decimal (floating point) value in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffIntervalTag - -:StandoffIntervalTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :IntervalBase ; - - rdfs:comment "Represents an interval in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffBooleanTag - -:StandoffBooleanTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :BooleanBase ; - - rdfs:comment "Represents a boolean in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffInternalReferenceTag - -:StandoffInternalReferenceTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :ValueBase, - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasInternalReference ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents an internal reference in a TextValue"@en . - - - -### http://www.knora.org/ontology/knora-base#StillImageFileValue - -:StillImageFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :dimY ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :dimX ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "A file containing a two-dimensional still image"@en . - - - -### http://www.knora.org/ontology/knora-base#StillImageRepresentation - -:StillImageRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStillImageFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Bild)"@de , - "Representation (Image)"@en , - "Répresentation (Image)"@fr , - "Rappresentazione (Imagine)"@it ; - - rdfs:comment "A resource that can contain a two-dimensional still image file"@en . - - - -### http://www.knora.org/ontology/knora-base#TextFileValue - -:TextFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue ; - - rdfs:comment "A text file such as plain Unicode text, LaTeX, TEI/XML, etc."@en . - - - -### http://www.knora.org/ontology/knora-base#TextRepresentation - -:TextRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasTextFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Text)"@de , - "Representation (Text)"@en , - "Répresentation (Texte)"@fr , - "Rappresentazione (testo)"@it ; - - rdfs:comment "A resource containing a text file"@en . - - -### http://www.knora.org/ontology/knora-base#ForbiddenResource - -:ForbiddenResource rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ]; - - rdfs:label """A ForbiddenResource is a proxy for a resource that the client has insufficient permissions to see."""@en ; - - rdfs:comment """A ForbiddenResource is a proxy for a resource that the client has insufficient permissions to see."""@en . - -### http://www.knora.org/ontology/knora-base#XSLTransformation - -:XSLTransformation rdf:type owl:Class ; - - rdfs:subClassOf :TextRepresentation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasTextFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "a TextRepresentation representing an XSL transformation that can be applied to an XML created from standoff. The transformation's result is ecptected to be HTML."@en ; - - rdfs:comment "a TextRepresentation representing an XSL transformation that can be applied to an XML created from standoff. The transformation's result is ecptected to be HTML."@en . - - -### http://www.knora.org/ontology/knora-base#MappingComponent - -:MappingComponent rdf:type owl:Class ; - - rdfs:label "Component of a mapping"@en ; - - rdfs:comment "Component of a mapping" . - - -### http://www.knora.org/ontology/knora-base#MappingStandoffDataTypeClass - -:MappingStandoffDataTypeClass rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttributename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffClass ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML attributes to standoff properties"@en ; - - rdfs:comment "Mapping from XML attributes to standoff properties" . - - -### http://www.knora.org/ontology/knora-base#MappingXMLAttribute - -:MappingXMLAttribute rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttributename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLNamespace ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffProperty ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML attributes to standoff properties"@en ; - - rdfs:comment "Mapping from XML attributes to standoff properties" . - - -### http://www.knora.org/ontology/knora-base#MappingElement - -:MappingElement rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLTagname ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLNamespace ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLClass ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffClass ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttribute ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffDataTypeClass ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingElementRequiresSeparator ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML to standoff entities"@en ; - - rdfs:comment "Mapping from XML to standoff entities" . - -### http://www.knora.org/ontology/knora-base#XMLToStandoffMapping - -:XMLToStandoffMapping rdf:type owl:Class ; - - rdfs:subClassOf - [ rdf:type owl:Restriction ; - owl:onProperty :hasMappingElement ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasDefaultXSLTransformation ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Mapping from XML to standoff entities"@en ; - - rdfs:comment "Mapping from XML to standoff entities" . - -### http://www.knora.org/ontology/knora-base#TextValue - -:TextValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStandoff ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasMaxStandoffStartIndex ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasLanguage ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasMapping ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ValueBase - -:ValueBase rdf:type owl:Class . - - -### http://www.knora.org/ontology/knora-base#Value - -:Value rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase, - [ rdf:type owl:Restriction ; - owl:onProperty :valueCreationDate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToUser ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasPermissions ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasOrder ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isDeleted ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deletedBy ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :previousValue ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasString ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasUUID ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - - rdfs:comment "The base class of classes representing Knora values"@en . diff --git a/upgrade/plugins/pr1322/knora-ontologies/salsah-gui.ttl b/upgrade/plugins/pr1322/knora-ontologies/salsah-gui.ttl deleted file mode 100644 index 6c183c0f51..0000000000 --- a/upgrade/plugins/pr1322/knora-ontologies/salsah-gui.ttl +++ /dev/null @@ -1,237 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix owl: . -@prefix rdf: . -@prefix xml: . -@prefix xsd: . -@prefix rdfs: . -@prefix knora-base: . -@prefix knora-admin: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The salsah-gui ontology"@en ; - - knora-base:attachedToProject knora-admin:SystemProject . - - -################################################################# -# -# Properties -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#guiOrder - -:guiOrder rdf:type owl:DatatypeProperty ; - - knora-base:subjectClassConstraint owl:Restriction ; - - knora-base:objectDatatypeConstraint xsd:nonNegativeInteger . - - - -### http://www.knora.org/ontology/salsah-gui#guiElement - -:guiElement rdf:type owl:ObjectProperty . - - - -### http://www.knora.org/ontology/salsah-gui#guiAttribute - -:guiAttribute rdf:type owl:DatatypeProperty ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/salsah-gui#guiAttributeDefinition - -:guiAttributeDefinition rdf:type owl:DatatypeProperty ; - - knora-base:subjectClassConstraint :Guielement ; - - knora-base:objectDatatypeConstraint xsd:string . - - - - - -################################################################# -# -# Classes -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#Guielement - -:Guielement rdf:type owl:Class . - - - - - -################################################################# -# -# Individuals -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#Colorpicker - -:Colorpicker rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "ncolors:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#Date - -:Date rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Geometry - -:Geometry rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Geonames - -:Geonames rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Iconclass - -# :Iconclass rdf:type :Guielement , -# owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Interval - -:Interval rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#List - -:List rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Pulldown - -:Pulldown rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Radio - -:Radio rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Richtext - -:Richtext rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Searchbox - -:Searchbox rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "numprops:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#SimpleText - -:SimpleText rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "size:integer" , - "maxlength:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#Slider - -:Slider rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "max(required):decimal" , - "min(required):decimal" . - - - -### http://www.knora.org/ontology/salsah-gui#Spinbox - -:Spinbox rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "max:decimal" , - "min:decimal" . - - - -### http://www.knora.org/ontology/salsah-gui#Textarea - -:Textarea rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "cols:integer" , - "rows:integer" , - "width:percent" , - "wrap:string(soft|hard)" . - - -### http://www.knora.org/ontology/salsah-gui#Checkbox - -:Checkbox rdf:type :Guielement , - owl:NamedIndividual . - - -### http://www.knora.org/ontology/salsah-gui#Fileupload - -:Fileupload rdf:type :Guielement , - owl:NamedIndividual . diff --git a/upgrade/plugins/pr1322/knora-ontologies/standoff-onto.ttl b/upgrade/plugins/pr1322/knora-ontologies/standoff-onto.ttl deleted file mode 100644 index f5113c5028..0000000000 --- a/upgrade/plugins/pr1322/knora-ontologies/standoff-onto.ttl +++ /dev/null @@ -1,356 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix xml: . -@prefix xsd: . -@prefix rdf: . -@prefix rdfs: . -@prefix owl: . -@prefix foaf: . -@prefix knora-base: . -@prefix knora-admin: . -@prefix salsah-gui: . -@base . - -@prefix : . - - rdf:type owl:Ontology ; - - rdfs:label "The standoff ontology"@en ; - - knora-base:attachedToProject knora-admin:SystemProject . - - -################################################################# -# -# Standoff Properties -# -################################################################# - -### http://www.knora.org/ontology/standoff#standoffRootTagHasDocumentType - -:standoffRootTagHasDocumentType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "describes the document type"@en ; - - knora-base:subjectClassConstraint :StandoffRootTag ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/standoff#standoffHyperlinkTagHasTarget - -:standoffHyperlinkTagHasTarget rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "describes the target settings of a hyperlink"@en ; - - knora-base:subjectClassConstraint :StandoffHyperlinkTag ; - - knora-base:objectDatatypeConstraint xsd:string . - - -################################################################# -# -# Intermediate Standoff Tags -# -################################################################# - -### http://www.knora.org/ontology/standoff#StandoffVisualTag - -:StandoffVisualTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag ; - - rdfs:comment "Represents visual markup information in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffStructuralTag - -:StandoffStructuralTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag ; - - rdfs:comment "Represents structural markup information in a TextValue"@en . - - -################################################################# -# -# Standoff Tags that can be instantiated -# -################################################################# - - -### http://www.knora.org/ontology/standoff#StandoffRootTag - -:StandoffRootTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffRootTagHasDocumentType ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents the root node if the TextValue has been created from XML"@en . - -### http://www.knora.org/ontology/standoff#StandoffHyperlinkTag - -:StandoffHyperlinkTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffUriTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffHyperlinkTagHasTarget ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a hyperlink in a text"@en . - -### http://www.knora.org/ontology/standoff#StandoffBlockquoteTag - -:StandoffBlockquoteTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a section that is quoted from another source in a text"@en . - - -### http://www.knora.org/ontology/standoff#StandoffCodeTag - -:StandoffCodeTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a section of computer source code in a text"@en . - - -### http://www.knora.org/ontology/standoff#StandoffParagraphTag - -:StandoffParagraphTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a paragraph in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader1Tag - -:StandoffHeader1Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 1 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader2Tag - -:StandoffHeader2Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 2 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader3Tag - -:StandoffHeader3Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 3 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader4Tag - -:StandoffHeader4Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 4 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader5Tag - -:StandoffHeader5Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 5 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader6Tag - -:StandoffHeader6Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 6 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffOrderedListTag - -:StandoffOrderedListTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents an ordered list in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffUnorderedListTag - -:StandoffUnorderedListTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents an unordered list in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffListElementTag - -:StandoffListElementTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a list element in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableBodyTag - -:StandoffTableBodyTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a table body in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableTag - -:StandoffTableTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a table in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableRowTag - -:StandoffTableRowTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a row in a table"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableCellTag - -:StandoffTableCellTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a cell in a table"@en . - - -### http://www.knora.org/ontology/standoff#StandoffBrTag - -:StandoffBrTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a linebreak"@en . - - - -### http://www.knora.org/ontology/standoff#StandoffItalicTag - -:StandoffItalicTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents italics in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffBoldTag - -:StandoffBoldTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents bold text in a TextValue"@en . - -### http://www.knora.org/ontology/standoff-html-editor#StandoffCiteTag - -:StandoffCiteTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents the title of a work in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffUnderlineTag - -:StandoffUnderlineTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents underlined text in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffStrikethroughTag - -:StandoffStrikethroughTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents struck text in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffSuperscriptTag - -:StandoffSuperscriptTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents superscript in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffSubscriptTag - -:StandoffSubscriptTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents subscript in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff-html-editor#StandoffLineTag - -:StandoffLineTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents a line to seperate content in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff-html-editor#StandoffPreTag - -:StandoffPreTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents a preformatted content in a TextValue"@en . diff --git a/upgrade/plugins/pr1322/test_1322.py b/upgrade/plugins/pr1322/test_1322.py deleted file mode 100644 index 55b3f172ee..0000000000 --- a/upgrade/plugins/pr1322/test_1322.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright @ 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - - -import tempfile -import rdflib -from rdflib.term import URIRef -from plugins.pr1322.update import GraphTransformer - - -save_output = False - - -def test_update(): - input_graph = rdflib.Graph() - input_graph.parse("plugins/pr1322/test_data.ttl", format="turtle") - transformer = GraphTransformer() - output_graph = transformer.transform(input_graph) - - query_result = output_graph.query( - """ - PREFIX knora-base: - - SELECT ?value WHERE { - ?value knora-base:valueHasUUID ?valueHasUUID . - } - """ - ) - - values_with_uuids = set([row["value"] for row in query_result]) - - assert values_with_uuids == { - URIRef("http://rdfh.ch/0001/thing-with-history/values/1c"), - URIRef("http://rdfh.ch/0001/thing-with-history/values/2c") - } - - if save_output: - temp_dir = tempfile.mkdtemp() - output_file_path = temp_dir + "/output.ttl" - output_graph.serialize(destination=output_file_path, format="turtle") - print("Wrote output to", output_file_path) diff --git a/upgrade/plugins/pr1322/test_data.ttl b/upgrade/plugins/pr1322/test_data.ttl deleted file mode 100644 index 1d5d09b513..0000000000 --- a/upgrade/plugins/pr1322/test_data.ttl +++ /dev/null @@ -1,73 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . -@prefix owl: . -@prefix knora-base: . -@prefix knora-admin: . -@prefix anything: . - - a anything:Thing; - knora-base:isDeleted false; - knora-base:attachedToUser ; - knora-base:attachedToProject ; - rdfs:label "A thing with version history"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:creationDate "2019-02-08T15:05:10Z"^^xsd:dateTime; - knora-base:lastModificationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; - anything:hasInteger ; - anything:hasText . - - a knora-base:IntValue; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-11T09:05:10Z"^^xsd:dateTime; - knora-base:valueHasInteger 1; - knora-base:valueHasOrder 0; - knora-base:valueHasString "1"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser . - - a knora-base:IntValue; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-12T09:05:10Z"^^xsd:dateTime; - knora-base:valueHasInteger 2; - knora-base:valueHasOrder 0; - knora-base:valueHasString "2"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser ; - knora-base:previousValue . - - a knora-base:IntValue; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; - knora-base:valueHasInteger 3; - knora-base:valueHasOrder 0; - knora-base:valueHasString "3"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser ; - knora-base:previousValue . - - a knora-base:TextValue; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-10T10:05:10Z"^^xsd:dateTime; - knora-base:valueHasOrder 0; - knora-base:valueHasString "one"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser . - - a knora-base:TextValue; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-11T10:05:10Z"^^xsd:dateTime; - knora-base:valueHasOrder 0; - knora-base:valueHasString "two"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser ; - knora-base:previousValue . - - a knora-base:TextValue; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-12T10:05:10Z"^^xsd:dateTime; - knora-base:valueHasOrder 0; - knora-base:valueHasString "three"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser ; - knora-base:previousValue . diff --git a/upgrade/plugins/pr1322/update.py b/upgrade/plugins/pr1322/update.py deleted file mode 100644 index 16e6d87938..0000000000 --- a/upgrade/plugins/pr1322/update.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright @ 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - - -import uuid -import base64 -import rdflib -from rdflib.namespace import XSD -from updatelib import rdftools - - -# The IRI of knora-base:TextValue. -text_value_type = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#TextValue") - -# The IRI of knora-base:valueHasUUID. -value_has_uuid = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#valueHasUUID") - -# The IRI of knora-base:valueCreationDate. -value_creation_date = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#valueCreationDate") - -# The IRI of knora-base:previousValue. -previous_value = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#previousValue") - - -# Updates values for PR 1322. -class GraphTransformer(rdftools.GraphTransformer): - def transform(self, graph): - # Check whether the transformation has already been done. - statements_with_value_has_uuid = graph.subject_objects(value_has_uuid) - - if not rdftools.generator_is_empty(statements_with_value_has_uuid): - print("This transformation seems to have been done already.") - return graph - - # Group the statements in the named graph by subject and by predicate. - grouped_statements = rdftools.group_statements(graph) - - # Collect the IRIs of values to be transformed. - value_iris = collect_value_iris(graph, grouped_statements) - - for value_iri in value_iris: - random_uuid_str = make_random_uuid_str() - graph.add((value_iri, value_has_uuid, rdflib.Literal(str(random_uuid_str), datatype=XSD.string))) - - return graph - - -# Given a graph, collects the IRIs of all values that are current value versions. -def collect_value_iris(graph, grouped_statements): - value_iris = set() - - for subj, pred_objs in grouped_statements.items(): - if value_creation_date in pred_objs: - # This is a value. Is it a current value version? - if rdftools.generator_is_empty(graph.subjects(previous_value, subj)): - # Yes. Include its IRI. - value_iris.add(subj) - - return value_iris - - -# Returns a random, Base64-encoded, URL-safe UUID. -def make_random_uuid_str(): - random_uuid = uuid.uuid4() - return base64.urlsafe_b64encode(random_uuid.bytes).decode("ascii").strip("=") - diff --git a/upgrade/plugins/pr1367/knora-ontologies/knora-admin.ttl b/upgrade/plugins/pr1367/knora-ontologies/knora-admin.ttl deleted file mode 100644 index c731a6f7e4..0000000000 --- a/upgrade/plugins/pr1367/knora-ontologies/knora-admin.ttl +++ /dev/null @@ -1,777 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix knora-base: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xml: . -@prefix xsd: . -@prefix foaf: . -@prefix dcterms: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The Knora admin ontology"@en ; - - knora-base:attachedToProject :SystemProject . - - -################################################################# -# -# Object Properties -# -################################################################# - - - -### http://www.knora.org/ontology/knora-admin#belongsToInstitution - -:belongsToInstitution rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates which Institution a project belongs to."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectClassConstraint :Institution . - - - -### http://www.knora.org/ontology/knora-admin#belongsToProject - -:belongsToProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates which project a group belongs to."@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#currentproject - -:currentproject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "This property indicates, which is the \"current project\" of a given user. A user can be part of any number of projects, but only one can be the active project."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#isInGroup - -:isInGroup rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given user is part of the given group."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :UserGroup . - - - -### http://www.knora.org/ontology/knora-admin#isInProject - -:isInProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given user is part of the given project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#isAdminForProject - -:isInProjectAdminGroup rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given user is part of the given project's ProjectAdmin group."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -################################################################# -# -# Datatype properties -# -################################################################# - - -### http://www.knora.org/ontology/knora-admin#address - -:address rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - knora-base:objectDatatypeConstraint xsd:string ; - - rdfs:comment "The address of a person or an institution"@en . - - -### http://www.knora.org/ontology/knora-admin#groupName - -:groupName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The group's name."@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectDatatypeConstraint xsd:string ; - - rdfs:subPropertyOf . - - - -### http://www.knora.org/ontology/knora-admin#groupDescription - -:groupDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of a user group"@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#hasSelfJoinEnabled - -:hasSelfJoinEnabled rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if users can add themselves to the project or group."@en ; - - # No knora-base:subjectClassConstraint, because this can be used with :knoraProject or :UserGroup. - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-admin#institutionName - -:institutionName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The institutions's name."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#institutionDescription - -:institutionDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of an institution."@en ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#institutionWebsite - -:institutionWebsite rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The URL of a web site."@en ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:anyURI . - - - -### http://www.knora.org/ontology/knora-admin#isActiveUser - -:isInSystemAdminGroup rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if the user is a member of the SystemAdmin group."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-admin#givenName - -:givenName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf foaf:givenName, :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The user's given name."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#familyName - -:familyName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf foaf:familyName, :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The user's family name."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#password - -:password rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "An encrypted credential for access"@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#phone - -:phone rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The phone number of a person, institution, etc."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#preferredLanguage - -:preferredLanguage rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The ISO 639-1 code of the user's preferred language."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectDescription - -:projectDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of a Knora project."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectKeyword - -:projectKeyword rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A keyword describing a project."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectLongname - -:projectLongname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The longname of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectLogo - -:projectLogo rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The path to the projects's logo."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectRestrictedViewSize - -:projectRestrictedViewSize rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The size of the image (as defined by IIIF) returned for restricted view."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectRestrictedViewWatermark - -:projectRestrictedViewWatermark rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The path to the restricted view watermark."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectShortname - -:projectShortname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The unique shortname of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectShortcode - -:projectShortcode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The unique short code of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#username - -:username rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The username and login name of a user."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#email - -:email rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The email address and login name of a user."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#status - -:status rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The status of the user / group / project. It is false if the entity has been deactivated (deleted)."@en ; - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -################################################################# -# -# Classes -# -################################################################# - - - -### http://www.knora.org/ontology/knora-admin#Institution - -:Institution rdf:type owl:Class ; - - rdfs:subClassOf foaf:Organization , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionDescription ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionWebsite ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :phone ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :address ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :email ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "An institution that has data in Knora."@en . - - - -### http://www.knora.org/ontology/knora-admin#User - -:User rdf:type owl:Class ; - - rdfs:subClassOf foaf:Person , - [ rdf:type owl:Restriction ; - owl:onProperty :username ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :email ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :familyName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :givenName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :password ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :preferredLanguage ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInProject ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInGroup ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInSystemAdminGroup ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a Knora user."@en . - - - -### http://www.knora.org/ontology/knora-admin#UserGroup - -:UserGroup rdf:type owl:Class ; - - rdfs:subClassOf foaf:Group , - [ rdf:type owl:Restriction ; - owl:onProperty :groupName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :groupDescription ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :belongsToProject ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:comment "A group of Knora users."@en . - - - - -### http://www.knora.org/ontology/knora-admin#knoraProject - -:knoraProject rdf:type owl:Class ; - - rdfs:subClassOf foaf:Project , - [ rdf:type owl:Restriction ; - owl:onProperty :projectShortname ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectShortcode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectLongname ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectDescription ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectKeyword ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectLogo ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectRestrictedViewSize ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectRestrictedViewWatermark ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :belongsToInstitution ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasSelfJoinEnabled ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a project that uses Knora."@en . - - - - -################################################################# -# -# Individuals -# -################################################################# - -### http://www.knora.org/ontology/knora-admin#UnknownUser -:UnknownUser rdf:type :UserGroup ; - :groupName "UnknownUser" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#KnownUser -:KnownUser rdf:type :UserGroup ; - :groupName "KnownUser" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#Creator -:Creator rdf:type :UserGroup ; - :groupName "Creator" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#ProjectMember -:ProjectMember rdf:type :UserGroup ; - :groupName "ProjectMember" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#ProjectAdmin -:ProjectAdmin rdf:type :UserGroup ; - :groupName "ProjectAdmin" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemAdmin -:SystemAdmin rdf:type :UserGroup ; - :groupName "SystemAdmin" ; - :belongsToProject :SystemProject ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemUser -:SystemUser rdf:type :User ; - rdfs:comment "A built-in system user."@en ; - :username "system"; - :email "system@localhost" ; - :givenName "Knora" ; - :familyName "System" ; - :password "-" ; - :status "true"^^xsd:boolean ; - :preferredLanguage "en" ; - :isInSystemAdminGroup "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#AnonymousUser -:AnonymousUser rdf:type :User ; - rdfs:comment "A built-in anonymous user."@en ; - :username "anonymous" ; - :email "anonymous@localhost" ; - :givenName "Knora" ; - :familyName "Anonymous" ; - :password "-" ; - :status "true"^^xsd:boolean ; - :preferredLanguage "en" ; - :isInSystemAdminGroup "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemProject -:SystemProject rdf:type :knoraProject ; - rdfs:comment "A built-in project representing the Knora System."@en ; - :projectShortname "SystemProject" ; - :projectShortcode "FFFF" ; - :projectLongname "Knora System Project" ; - :projectDescription "Knora System Project"@en ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - - -### http://www.knora.org/ontology/knora-admin#SharedOntologiesProject -:DefaultSharedOntologiesProject rdf:type :knoraProject ; - rdfs:comment "The default project for shared ontologies."@en ; - :projectShortname "DefaultSharedOntologiesProject" ; - :projectShortcode "0000" ; - :projectLongname "Knora Default Shared Ontologies Project" ; - :projectDescription "Knora Shared Ontologies Project"@en ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - -# -## -### Permission Class Properties -## -# -### http://www.knora.org/ontology/knora-admin#forProject - -:forProject rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a knoraProject."@en ; - knora-base:subjectClassConstraint :Permission ; - knora-base:objectClassConstraint :knoraProject . - -### http://www.knora.org/ontology/knora-admin#forGroup -:forGroup rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a UserGroup."@en ; - knora-base:subjectClassConstraint :Permission ; - knora-base:objectClassConstraint :UserGroup . - -### http://www.knora.org/ontology/knora-admin#forResourceClass -:forResourceClass rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a resource class."@en ; - knora-base:subjectClassConstraint :Permission . - -### http://www.knora.org/ontology/knora-admin#forProperty -:forProperty rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a resource property."@en ; - knora-base:subjectClassConstraint :Permission . - - -# -## -### Permission Class and Sub-Classes -## -# -### http://www.knora.org/ontology/knora-admin#Permission -:Permission rdf:type owl:Class ; - rdfs:comment "Base Permission class."@en. - - -### http://www.knora.org/ontology/knora-admin#AdministrativePermission -:AdministrativePermission rdf:type owl:Class ; - rdfs:comment "Administrative Permission class used to create instances for storing administrative permissions on groups."@en ; - rdfs:subClassOf :Permission . - -### http://www.knora.org/ontology/knora-admin#DefaultObjectAccessPermission -:DefaultObjectAccessPermission rdf:type owl:Class ; - rdfs:comment "Default Object Access Permission class used to create instances for storing default object access permission for a project and either groups, resource classes, or properties."@en ; - rdfs:subClassOf :Permission . diff --git a/upgrade/plugins/pr1367/knora-ontologies/knora-base.ttl b/upgrade/plugins/pr1367/knora-ontologies/knora-base.ttl deleted file mode 100644 index 00e108f7b6..0000000000 --- a/upgrade/plugins/pr1367/knora-ontologies/knora-base.ttl +++ /dev/null @@ -1,2710 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xml: . -@prefix xsd: . -@prefix foaf: . -@prefix dcterms: . -@prefix salsah-gui: . -@prefix knora-admin: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The Knora base ontology"@en ; - - :attachedToProject knora-admin:SystemProject ; - - :ontologyVersion "PR 1367" . - - - -################################################################# -# -# Properties -# -################################################################# - - - -### http://www.knora.org/ontology/knora-base#ontologyVersion - -:ontologyVersion rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates the version of the Knora built-in ontologies in a repository."@en ; - - :subjectClassConstraint owl:Ontology ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#isMainResource - -# This property is generated by a SPARQL CONSTRUCT query, it is not used in the triplestore and not used in the API - -:isMainResource rdf:type owl:DatatypeProperty ; - - rdfs:comment "Indicates if the given resource is the main resource of a request or a resource referred to by a link property."@en; - - :subjectClassConstraint :Resource ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#objectCannotBeMarkedAsDeleted - -:objectCannotBeMarkedAsDeleted rdf:type rdf:Property ; - - rdfs:comment "The base property of properties whose objects can't be marked as deleted"@en . - - - -### http://www.knora.org/ontology/knora-base#objectDatatypeConstraint - -:objectDatatypeConstraint rdf:type owl:DatatypeProperty ; - - rdfs:comment "Specifies the type required as the object of a datatype property"@en . - - - -### http://www.knora.org/ontology/knora-base#resourceIcon - -:resourceIcon rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint owl:Class ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#resourceProperty - -:resourceProperty rdf:type owl:ObjectProperty ; - - rdfs:comment "The base property of properties that point from Knora resources to Knora resources or values. These properties are required to have cardinalities in the resource classes in which they are used."@en ; - - :subjectClassConstraint :Resource . - - - -### http://www.knora.org/ontology/knora-base#subjectClassConstraint - -:subjectClassConstraint rdf:type owl:ObjectProperty ; - - rdfs:comment "Specifies the OWL class that the subject of a property must belong to"@en . - - - -### http://www.knora.org/ontology/knora-base#objectClassConstraint - -:objectClassConstraint rdf:type owl:ObjectProperty ; - - rdfs:comment "Specifies the OWL class that the object of a property must belong to"@en . - - - -### http://www.knora.org/ontology/knora-base#isEditable - -:isEditable rdf:type owl:AnnotationProperty ; - - :objectDatatypeConstraint xsd:boolean ; - - rdfs:label "is editable"@en ; - - rdfs:comment "Indicates whether a property's values can be updated via the Knora API."@en . - - - -### http://www.knora.org/ontology/knora-base#canBeInstantiated - -:canBeInstantiated rdf:type owl:AnnotationProperty ; - - :subjectClassConstraint owl:Class ; - - :objectDatatypeConstraint xsd:boolean ; - - rdfs:label "can be instantiated"@en ; - - rdfs:comment "Indicates whether a resource class can be instantiated via the Knora API."@en . - - - -### http://www.knora.org/ontology/knora-base#attachedToProject - -:attachedToProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "attached to project"@en ; - - rdfs:comment "Connects something to a project"@en ; - - :objectClassConstraint knora-admin:knoraProject . - - - -### http://www.knora.org/ontology/knora-base#attachedToUser - -:attachedToUser rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "attached to user"@en ; - - rdfs:comment "Connects something to a user"@en ; - - :objectClassConstraint knora-admin:User . - - -### http://www.knora.org/ontology/knora-base#hasColor - -:hasColor rdf:type owl:ObjectProperty ; - - rdfs:label "Farbe"@de , - "Color"@en , - "Couleur"@fr , - "Colore"@it ; - - rdfs:comment """Specifies the color of a region."""@en ; - - salsah-gui:guiAttribute "ncolors=8"^^xsd:string ; - - :objectClassConstraint :ColorValue ; - - :subjectClassConstraint :Region ; - - rdfs:subPropertyOf :hasValue ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Colorpicker . - - - -### http://www.knora.org/ontology/knora-base#hasComment - -:hasComment rdf:type owl:ObjectProperty ; - - rdfs:label "Kommentar"@de , - "Comment"@en , - "Commentaire"@fr , - "Commento"@it ; - - rdfs:comment """Represents a comment on a resource as a knora-base:TextValue"""@de ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :TextValue ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Richtext ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasExtResValue - -:hasExtResValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat externen Wert"@de , - "has external Value"@en , - "a valeur externe"@fr , - "ha valore esterno"@it ; - - :objectClassConstraint :ExternalResValue ; - - :subjectClassConstraint :ExternalResource ; - - rdfs:subPropertyOf :hasValue . - - -### http://www.knora.org/ontology/knora-base#hasFileValue - -:hasFileValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :FileValue ; - - rdfs:label "hat Datei"@de , - "has file"@en , - "a fichier"@fr , - "ha file"@it ; - - rdfs:comment "Connects a Representation to a file"@en ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - :subjectClassConstraint :Representation ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasStillImageFileValue - -:hasStillImageFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Bilddatei"@de , - "has image file"@en , - "a fichier d'image"@fr , - "ha file imagine"@it ; - - rdfs:comment "Connects a Representation to an image file"@en ; - - :objectClassConstraint :StillImageFileValue ; - - :subjectClassConstraint :StillImageRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasMovingImageFileValue - -:hasMovingImageFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Filmdatei"@de , - "has movie file"@en , - "a fichier de film"@fr , - "ha file film"@it ; - - rdfs:comment "Connects a Representation to a movie file"@en ; - - :objectClassConstraint :MovingImageFileValue ; - - :subjectClassConstraint :MovingImageRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasAudioFileValue - -:hasAudioFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Audiodatei"@de , - "has audio file"@en , - "a fichier d'audio"@fr , - "ha file audio"@it ; - - rdfs:comment "Connects a Representation to an audio file"@en ; - - :objectClassConstraint :AudioFileValue ; - - :subjectClassConstraint :AudioRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasDDDFileValue - -:hasDDDFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat 3D-Datei"@de , - "has 3D-file"@en , - "a ficher de 3D"@fr , - "ha file 3D"@it ; - - rdfs:comment "Connects a Representation to a 3D-file"@en ; - - :objectClassConstraint :DDDFileValue ; - - :subjectClassConstraint :DDDRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasTextFileValue - -:hasTextFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Textdatei"@de , - "has text file"@en , - "a fichier de texte"@fr , - "ha file testo"@it ; - - rdfs:comment "Connects a Representation to a text file"@en ; - - :objectClassConstraint :TextFileValue ; - - :subjectClassConstraint :TextRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasDocumentFileValue - -:hasDocumentFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Dokument"@de , - "has document"@en , - "a document"@fr , - "ha documento"@it ; - - rdfs:comment "Connects a Representation to a document"@en ; - - :objectClassConstraint :DocumentFileValue ; - - :subjectClassConstraint :DocumentRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasGeometry - -:hasGeometry rdf:type owl:ObjectProperty ; - - rdfs:label "Geometrie"@de , - "Geometry"@en , - "Géometrie"@fr , - "Geometria"@it ; - - rdfs:comment """Represents a geometrical shape."""@en ; - - rdfs:subPropertyOf :hasValue ; - - salsah-gui:guiElement salsah-gui:Geometry ; - - :isEditable true ; - - :objectClassConstraint :GeomValue ; - - :subjectClassConstraint :Region . - - - -### http://www.knora.org/ontology/knora-base#hasLinkTo - -:hasLinkTo rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :resourceProperty ; - - rdfs:label "hat Link zu"@de , - "has Link to"@en , - "a lien vers"@fr , - "ha Link verso"@it ; - - rdfs:comment "Represents a direct connection between two resources"@en ; - - :isEditable true ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :Resource . - - - -### http://www.knora.org/ontology/knora-base#hasLinkToValue - -:hasLinkToValue rdf:type owl:ObjectProperty ; - - rdfs:comment "Points to a LinkValue reification describing a link between two resources"@en ; - - rdfs:label "hat Link zu"@de , - "has Link to"@en , - "a lien vers"@fr , - "ha Link verso"@it ; - - rdfs:comment "Represents a direct connection between two resources"@en ; - - :isEditable true ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasRepresentation - -:hasRepresentation rdf:type owl:ObjectProperty ; - - rdfs:label "hat Repräsentation"@de , - "has Representation"@en , - "a Répresentation"@fr , - "ha Rappresentazione"@it ; - - rdfs:comment "References an instance of a Representation. A Representation contains the metadata of a digital object (= file) which represents some physical entity such as an image, a sound, an encoded text etc."@en ; - - :objectClassConstraint :Representation ; - - :subjectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#hasRepresentationValue - -:hasRepresentationValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - - -### http://www.knora.org/ontology/knora-base#hasStandoffLinkTo - -:hasStandoffLinkTo rdf:type owl:ObjectProperty ; - - rdfs:label "hat Standoff Link zu"@de , - "has Standoff Link to"@en , - "a standoff lien vers"@fr , - "ha standoff link verso"@it ; - - rdfs:comment "Repräsentiert einen Link im Standoff Markup von einer Ressource zu einer anderen"@de , - "Represents a link in standoff markup from one resource to another."@en ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#hasStandoffLinkToValue - -:hasStandoffLinkToValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Standoff Link zu"@de , - "has Standoff Link to"@en , - "a standoff lien vers"@fr , - "ha standoff link verso"@it ; - - rdfs:comment "Repräsentiert einen Link im Standoff Markup von einer Ressource zu einer anderen"@de , - "Represents a link in standoff markup from one resource to another."@en ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#standoffTagHasLink - -:standoffTagHasLink rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :StandoffLinkTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasInternalReference - -:standoffTagHasInternalReference rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :StandoffTag ; - - :subjectClassConstraint :StandoffInternalReferenceTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStart - -:standoffTagHasStart rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEnd - -:standoffTagHasEnd rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartIndex - -:standoffTagHasStartIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEndIndex - -:standoffTagHasEndIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartAncestor - -:standoffTagHasStartAncestor rdf:type owl:ObjectProperty, owl:TransitiveProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartParent - -:standoffTagHasStartParent rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted, :standoffTagHasStartAncestor ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEndParent - -:standoffTagHasEndParent rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasUUID - -:standoffTagHasUUID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:string . - - -:valueHasMaxStandoffStartIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#hasSubListNode - -:hasSubListNode rdf:type owl:ObjectProperty ; - - rdfs:comment "A hierarchical list is formed using the \"hasSubListNode\"-property"@en ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :ListNode ; - - :subjectClassConstraint :ListNode . - - -### http://www.knora.org/ontology/knora-base#hasValue - -:hasValue rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :resourceProperty ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :Value . - - -### http://www.knora.org/ontology/knora-base#isAnnotationOf - -:isAnnotationOf rdf:type owl:ObjectProperty ; - - rdfs:label "ist Annotation von"@de , - "is Annotation of"@en , - "est Annotation de"@fr , - "è Annotation di"@it ; - - :subjectClassConstraint :Annotation ; - - :objectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isAnnotationOfValue - -:isAnnotationOfValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Annotation ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#isPartOf - -:isPartOf rdf:type owl:ObjectProperty ; - - rdfs:label "ist Teil von"@de , - "is part of"@en , - "fait partie de"@fr , - "fa parte di"@it ; - - rdfs:comment "Indicates that this resource is part of another resource"@en ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isPartOfValue - -:isPartOfValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#isRegionOf - -:isRegionOf rdf:type owl:ObjectProperty ; - - rdfs:comment "Region of interest within a digital object (e.g. an image)"@en ; - - rdfs:label "is Region von"@de , - "is region of"@en , - "est région de"@fr , - "è regione di"@it ; - - :subjectClassConstraint :Region ; - - :objectClassConstraint :Representation ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isRegionOfValue - -:isRegionOfValue rdf:type owl:ObjectProperty ; - - rdfs:comment "Region of interest within a digital object (e.g. an image)"@en ; - - rdfs:label "is Region von"@de , - "is region of"@en , - "est région de"@fr , - "è regione di"@it ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Region ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#previousValue - -:previousValue rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "Points to the previous verson of a value"@en ; - - :subjectClassConstraint :Value ; - - :objectClassConstraint :Value . - - - -### http://www.knora.org/ontology/knora-base#seqnum - -:seqnum rdf:type owl:ObjectProperty ; - - :objectClassConstraint :IntValue ; - - rdfs:subPropertyOf :hasValue ; - - rdfs:label "Sequenznummer"@de , - "Sequence number"@en , - "Numéro de séquence"@fr , - "Numero di sequenza"@it ; - - rdfs:comment "Indicates the position of a resource within a sequence"@en . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasOriginalXMLID - -:standoffTagHasOriginalXMLID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:string ; - - :subjectClassConstraint :StandoffTag . - - - -### http://www.knora.org/ontology/knora-base#valueHasStandoff - -:valueHasStandoff rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :objectClassConstraint :StandoffTag ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#valueHasLanguage - -:valueHasLanguage rdf:type owl:DatatypeProperty ; - - :objectDatatypeConstraint xsd:string ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#valueHasMapping - -:valueHasMapping rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :objectClassConstraint :XMLToStandoffMapping ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#hasMappingElement - -:hasMappingElement rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "mapping element"@en ; - - rdfs:comment """Represents an element in a mapping"""@en ; - - :subjectClassConstraint :XMLToStandoffMapping ; - - :objectClassConstraint :MappingElement . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLTagname - -:mappingHasXMLTagname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML tag"@en ; - - rdfs:comment """name of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLNamespace - -:mappingHasXMLNamespace rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "namespace of the XML tag"@en ; - - rdfs:comment """namespace of the XML tag"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLClass - -:mappingHasXMLClass rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "class of the XML tag"@en ; - - rdfs:comment """class of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffClass - -:mappingHasStandoffClass rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "IRI of the standoff class"@en ; - - rdfs:comment """IRI of the standoff class"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectClassConstraint owl:Class . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLAttribute - -:mappingHasXMLAttribute rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML attribute"@en ; - - rdfs:comment """name of the XML attribute"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectClassConstraint :MappingXMLAttribute . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLAttributename - -:mappingHasXMLAttributename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML attribute"@en ; - - rdfs:comment """name of the XML attribute"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffProperty - -:mappingHasStandoffProperty rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "IRI of the standoff property"@en ; - - rdfs:comment """IRI of the standoff property"""@en ; - - :subjectClassConstraint :MappingXMLAttribute . - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffDataTypeClass - -:mappingHasStandoffDataTypeClass rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "datatype of the XML tag"@en ; - - rdfs:comment """datatype of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectClassConstraint :MappingStandoffDataTypeClass . - - -### http://www.knora.org/ontology/knora-base#mappingElementRequiresSeparator - -:mappingElementRequiresSeparator rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "indicates if the element requires a separator in the text"@en ; - - rdfs:comment """indicates if the element requires a separator in the text"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:boolean . - - -### http://www.knora.org/ontology/knora-base#mappingHasDefaultXSLTransformation - -:mappingHasDefaultXSLTransformation rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "default XSL Transformation"@en ; - - rdfs:comment """default XSL Transformation for this mapping"""@en ; - - :subjectClassConstraint :XMLToStandoffMapping ; - - :objectClassConstraint :XSLTransformation . - - -### http://www.knora.org/ontology/knora-base#deletedBy - -:deletedBy rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates who deleted a resource or value"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectClassConstraint knora-admin:User . - - -################################################################# -# -# Datatype properties -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#creationDate - -:creationDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates when a resource was created"@en ; - - :subjectClassConstraint :Resource ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#deleteDate - -:deleteDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates when a resource or value was deleted"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:dateTime . - - -### http://www.knora.org/ontology/knora-base#dimX - -:dimX rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :FileValue ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#dimY - -:dimY rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :FileValue ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#duration - -:duration rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#extResAccessInfo - -:extResAccessInfo rdf:type owl:DatatypeProperty ; - - rdfs:comment "Information (URL etc.) for accessing an external resource"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#extResId - -:extResId rdf:type owl:DatatypeProperty ; - - rdfs:comment "The ID of the external resource. The form of the ID is dependent on the provider."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#extResProvider - -:extResProvider rdf:type owl:DatatypeProperty ; - - rdfs:comment "The name of the external provider of the resource"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - - -### http://www.knora.org/ontology/knora-base#fps - -:fps rdf:type owl:DatatypeProperty ; - - rdfs:label "Frames per second"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :MovingImageFileValue ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#internalFilename - -:internalFilename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#internalMimeType - -:internalMimeType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#isDeleted - -:isDeleted rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if the resource has been deleted"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#isRootNode - -:isRootNode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#hasRootNode - -:hasRootNode rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint :ListNode . - - - - -### http://www.knora.org/ontology/knora-base#lastModificationDate - -:lastModificationDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#listNodePosition - -:listNodePosition rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#listNodeName - -:listNodeName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#originalFilename - -:originalFilename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#originalMimeType - -:originalMimeType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasComment - -:valueHasComment rdf:type owl:DatatypeProperty ; - - rdfs:comment "A comment on a value"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#deleteComment - -:deleteComment rdf:type owl:DatatypeProperty ; - - rdfs:comment "A comment explaining why a resource or value was marked as deleted"@en ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueCreationDate - -:valueCreationDate rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :Value ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#valueHas - -:valueHas rdf:type rdf:Property ; - - :subjectClassConstraint :ValueBase ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted . - - - -### http://www.knora.org/ontology/knora-base#valueHasUUID - -:valueHasUUID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "The UUID of a value"@en ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasCalendar - -:valueHasCalendar rdf:type owl:DatatypeProperty ; - - rdfs:comment "Name of the calendar to be used, such as \"GREGORIAN\" or \"JULIAN\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasColor - -:valueHasColor rdf:type owl:DatatypeProperty ; - - rdfs:comment "Color in the form of #rrggbb (as defining web colors)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ColorBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasEndJDN - -:valueHasEndJDN rdf:type owl:DatatypeProperty ; - - rdfs:comment "Contains the end of a date as a Julian Day Number (JDN)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasEndPrecision - -:valueHasEndPrecision rdf:type owl:DatatypeProperty ; - - rdfs:comment "Precision of knowledge about the end of the date. Allowed are \"DAY\", \"MONTH\" or \"YEAR\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasDecimal - -:valueHasDecimal rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DecimalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasGeometry - -:valueHasGeometry rdf:type owl:DatatypeProperty ; - - rdfs:comment "JSON string describing a geometry (e.g. a region). Currently geometries are limited to 2D unions of primitive objects like circles, squares and polygons."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :GeomValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasGeonameCode - -:valueHasGeonameCode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :GeonameValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasInteger - -:valueHasInteger rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasBoolean - -:valueHasBoolean rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :BooleanBase ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#valueHasUri - -:valueHasUri rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :UriBase ; - - :objectDatatypeConstraint xsd:anyURI . - - - -### http://www.knora.org/ontology/knora-base#valueHasIntervalEnd - -:valueHasIntervalEnd rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntervalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasIntervalStart - -:valueHasIntervalStart rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntervalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasListNode - -:valueHasListNode rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ListValue ; - - :objectClassConstraint :ListNode . - - - -### http://www.knora.org/ontology/knora-base#valueHasOrder - -:valueHasOrder rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#valueHasRefCount - -:valueHasRefCount rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :LinkValue ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasStartJDN - -:valueHasStartJDN rdf:type owl:DatatypeProperty ; - - rdfs:comment "Contains the start of a date as a Julian Day Number (JDN)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasStartPrecision - -:valueHasStartPrecision rdf:type owl:DatatypeProperty ; - - rdfs:comment "The precision the start of a date. Allowed values are \"DAY\", \"MONTH\", or \"YEAR\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasString - -:valueHasString rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "A string representation of a value, required for full-text searches and search results."@en ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#hasPermissions - -:hasPermissions rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:string . - - - -################################################################# -# -# Classes -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#Annotation - -:Annotation rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isAnnotationOf ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isAnnotationOfValue ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Annotation"@de , - "Annotation"@en , - "Annotation"@fr , - "Annotation"@it ; - - :canBeInstantiated true ; - - rdfs:comment "A generic class for representing annotations"@en . - - - -### http://www.knora.org/ontology/knora-base#AudioFileValue - -:AudioFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :duration ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents an audio file"@en . - - - -### http://www.knora.org/ontology/knora-base#AudioRepresentation - -:AudioRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasAudioFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Audio)"@de , - "Representation (Audio)"@en , - "Répresentation (Audio)"@fr , - "Rappresentazione (Audio)"@it ; - - rdfs:comment "Represents a file containing audio data"@en . - - -### http://www.knora.org/ontology/knora-base#ColorBase - -:ColorBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasColor ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#ColorValue - -:ColorValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :ColorBase ; - - rdfs:comment "Represents a color in HTML format, e.g. \"#33eeff\""@en . - - - -### http://www.knora.org/ontology/knora-base#DDDFileValue - -:DDDFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue ; - - rdfs:comment "This represents some 3D-object with mesh data, point cloud, etc."@en . - - - -### http://www.knora.org/ontology/knora-base#DDDRepresentation - -:DDDRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasDDDFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (3D)"@de , - "Representation (3D)"@en , - "Répresentation (3D)"@fr , - "Rappresentazione (3D)"@it ; - - rdfs:comment "Represents a file containg 3D data"@en . - - -### http://www.knora.org/ontology/knora-base#DateBase - -:DateBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasCalendar ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasEndPrecision ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasEndJDN ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStartPrecision ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStartJDN ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#DateValue - -:DateValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :DateBase ; - - rdfs:comment "Represents a Knora date value"@en . - - - -### http://www.knora.org/ontology/knora-base#DocumentFileValue - -:DocumentFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue . - - - -### http://www.knora.org/ontology/knora-base#DocumentRepresentation - -:DocumentRepresentation rdf:type owl:Class ; - - rdfs:label "Repräsentation (Dokument)"@de , - "Representation (Document)"@en , - "Répresentation (Document)"@fr , - "Rappresentazione (Documento)"@it ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasDocumentFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ExternalResValue - -:ExternalResValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :extResId ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :extResProvider ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :extResAccessInfo ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ExternalResource - -:ExternalResource rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasExtResValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Externe Ressource"@de , - "External Resource"@en , - "Ressource Externe"@fr , - "Risorsa esterna"@it ; - - rdfs:comment "Represents a proxy for an object stored by an external provider"@en . - - - -### http://www.knora.org/ontology/knora-base#FileValue - -:FileValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :originalMimeType ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :internalFilename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :internalMimeType ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :originalFilename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#DecimalBase - -:DecimalBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasDecimal ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#DecimalValue - -:DecimalValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :DecimalBase ; - - rdfs:comment "Represents an arbitrary-precision decimal value"@en . - - - -### http://www.knora.org/ontology/knora-base#GeomValue - -:GeomValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasGeometry ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a geometrical objects as JSON string"@en . - - - -### http://www.knora.org/ontology/knora-base#GeonameValue - -:GeonameValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasGeonameCode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#IntBase - -:IntBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasInteger ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#IntValue - -:IntValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :IntBase ; - - rdfs:comment "Represents an integer value"@en . - -### http://www.knora.org/ontology/knora-base#BooleanBase - -:BooleanBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasBoolean ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#BooleanValue - -:BooleanValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :BooleanBase ; - - rdfs:comment "Represents a boolean value"@en . - - - -### http://www.knora.org/ontology/knora-base#UriBase - -:UriBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasUri ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - -### http://www.knora.org/ontology/knora-base#UriValue - -:UriValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :UriBase ; - - rdfs:comment "Represents a URI"@en . - -### http://www.knora.org/ontology/knora-base#IntervalBase - -:IntervalBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasIntervalEnd ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasIntervalStart ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#IntervalValue - -:IntervalValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :IntervalBase ; - - rdfs:comment "Represents a time interval, e.g. in an audio recording"@en . - - - -### http://www.knora.org/ontology/knora-base#LinkObj - -:LinkObj rdf:type owl:Class ; - - rdfs:label "Verknüpfungsobjekt"@de , - "Link Object"@en , - "Objet de lien"@fr , - "Oggetto di connessione"@it ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasLinkTo ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasLinkToValue ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - :resourceIcon "link.gif"^^xsd:string ; - - :canBeInstantiated true ; - - rdfs:comment "Verknüpfung mehrerer Resourcen"@de , - "Represents a generic link object"@en . - - - -### http://www.knora.org/ontology/knora-base#LinkValue - -:LinkValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - rdf:Statement , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasRefCount ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:subject ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:predicate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:object ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "A reification node that describes direct links between resources"@en . - - - -### http://www.knora.org/ontology/knora-base#ListNode - -:ListNode rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :hasSubListNode ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :listNodePosition ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :listNodeName ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRootNode ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasRootNode ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToProject ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdfs:label ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:comment "Represents a flat or hierarchical list"@en . - - - -### http://www.knora.org/ontology/knora-base#ListValue - -:ListValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasListNode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#MovingImageFileValue - -:MovingImageFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :dimX ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :dimY ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :fps ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :duration ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a moving image file"@en . - - - -### http://www.knora.org/ontology/knora-base#MovingImageRepresentation - -:MovingImageRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasMovingImageFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Video)"@de , - "Representation (Movie)"@en , - "Répresentation (Film)"@fr , - "Rappresentazione (Film)"@it ; - - rdfs:comment "A resource containing moving image data"@en . - - - -### http://www.knora.org/ontology/knora-base#Region - -:Region rdf:type owl:Class ; - - rdfs:label "Region"@de , - "Region"@en , - "Région"@fr , - "Regione"@it ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasColor ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRegionOf ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasGeometry ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRegionOfValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - :resourceIcon "region.gif"^^xsd:string ; - - :canBeInstantiated true ; - - rdfs:comment "Represents a geometric region of a resource. The geometry is represented currently as JSON string."@en . - - - -### http://www.knora.org/ontology/knora-base#Representation - -:Representation rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation"@de , - "Representation"@en , - "Répresentation"@fr , - "Rappresentazione"@it ; - - rdfs:comment "A resource that can store a file"@en . - - - -### http://www.knora.org/ontology/knora-base#Resource - -:Resource rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty rdfs:label ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isDeleted ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStandoffLinkTo ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStandoffLinkToValue ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToUser ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToProject ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasPermissions ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :creationDate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :lastModificationDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deletedBy ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Ressource"@de , - "Resource"@en , - "Ressource"@fr , - "Risorsa"@it ; - - rdfs:comment "Represents something in the world, or an abstract thing"@en . - - -################################################################# -# -# Generic Standoff Tag -# -################################################################# - - -:standoffParentClassConstraint rdf:type owl:ObjectProperty . - - -### http://www.knora.org/ontology/knora-base#StandoffTag - -:StandoffTag rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStart ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEnd ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasUUID ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasOriginalXMLID ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStartIndex ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEndIndex ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStartParent ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEndParent ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffParentClassConstraint; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a standoff markup tag"@en . - - - -################################################################# -# -# Abstract Standoff Data Type Tag -# -################################################################# - -### http://www.knora.org/ontology/knora-base#StandoffDataTypeTag - -:StandoffDataTypeTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffTag ; - - rdfs:comment "Represents a knora-base value type in a TextValue"@en . - - -################################################################# -# -# Standoff Data Type Tags that can be instantiated -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#StandoffLinkTag - -:StandoffLinkTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasLink ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a reference to a Knora resource in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffUriTag - -:StandoffUriTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag , - :UriBase ; - - rdfs:comment "Represents an arbitrary URI in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffDateTag - -:StandoffDateTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :DateBase ; - - rdfs:comment "Represents a date in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffColorTag - -:StandoffColorTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :ColorBase ; - - rdfs:comment "Represents a color in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffIntegerTag - -:StandoffIntegerTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :IntBase ; - - rdfs:comment "Represents an integer value in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffDecimalTag - -:StandoffDecimalTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :DecimalBase ; - - rdfs:comment "Represents a decimal (floating point) value in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffIntervalTag - -:StandoffIntervalTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :IntervalBase ; - - rdfs:comment "Represents an interval in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffBooleanTag - -:StandoffBooleanTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :BooleanBase ; - - rdfs:comment "Represents a boolean in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffInternalReferenceTag - -:StandoffInternalReferenceTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :ValueBase, - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasInternalReference ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents an internal reference in a TextValue"@en . - - - -### http://www.knora.org/ontology/knora-base#StillImageFileValue - -:StillImageFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :dimY ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :dimX ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "A file containing a two-dimensional still image"@en . - - - -### http://www.knora.org/ontology/knora-base#StillImageRepresentation - -:StillImageRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStillImageFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Bild)"@de , - "Representation (Image)"@en , - "Répresentation (Image)"@fr , - "Rappresentazione (Imagine)"@it ; - - rdfs:comment "A resource that can contain a two-dimensional still image file"@en . - - - -### http://www.knora.org/ontology/knora-base#TextFileValue - -:TextFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue ; - - rdfs:comment "A text file such as plain Unicode text, LaTeX, TEI/XML, etc."@en . - - - -### http://www.knora.org/ontology/knora-base#TextRepresentation - -:TextRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasTextFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Text)"@de , - "Representation (Text)"@en , - "Répresentation (Texte)"@fr , - "Rappresentazione (testo)"@it ; - - rdfs:comment "A resource containing a text file"@en . - - -### http://www.knora.org/ontology/knora-base#ForbiddenResource - -:ForbiddenResource rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ]; - - rdfs:label """A ForbiddenResource is a proxy for a resource that the client has insufficient permissions to see."""@en ; - - rdfs:comment """A ForbiddenResource is a proxy for a resource that the client has insufficient permissions to see."""@en . - -### http://www.knora.org/ontology/knora-base#XSLTransformation - -:XSLTransformation rdf:type owl:Class ; - - rdfs:subClassOf :TextRepresentation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasTextFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "a TextRepresentation representing an XSL transformation that can be applied to an XML created from standoff. The transformation's result is ecptected to be HTML."@en ; - - rdfs:comment "a TextRepresentation representing an XSL transformation that can be applied to an XML created from standoff. The transformation's result is ecptected to be HTML."@en . - - -### http://www.knora.org/ontology/knora-base#MappingComponent - -:MappingComponent rdf:type owl:Class ; - - rdfs:label "Component of a mapping"@en ; - - rdfs:comment "Component of a mapping" . - - -### http://www.knora.org/ontology/knora-base#MappingStandoffDataTypeClass - -:MappingStandoffDataTypeClass rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttributename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffClass ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML attributes to standoff properties"@en ; - - rdfs:comment "Mapping from XML attributes to standoff properties" . - - -### http://www.knora.org/ontology/knora-base#MappingXMLAttribute - -:MappingXMLAttribute rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttributename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLNamespace ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffProperty ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML attributes to standoff properties"@en ; - - rdfs:comment "Mapping from XML attributes to standoff properties" . - - -### http://www.knora.org/ontology/knora-base#MappingElement - -:MappingElement rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLTagname ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLNamespace ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLClass ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffClass ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttribute ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffDataTypeClass ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingElementRequiresSeparator ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML to standoff entities"@en ; - - rdfs:comment "Mapping from XML to standoff entities" . - -### http://www.knora.org/ontology/knora-base#XMLToStandoffMapping - -:XMLToStandoffMapping rdf:type owl:Class ; - - rdfs:subClassOf - [ rdf:type owl:Restriction ; - owl:onProperty :hasMappingElement ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasDefaultXSLTransformation ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Mapping from XML to standoff entities"@en ; - - rdfs:comment "Mapping from XML to standoff entities" . - -### http://www.knora.org/ontology/knora-base#TextValue - -:TextValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStandoff ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasMaxStandoffStartIndex ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasLanguage ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasMapping ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ValueBase - -:ValueBase rdf:type owl:Class . - - -### http://www.knora.org/ontology/knora-base#Value - -:Value rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase, - [ rdf:type owl:Restriction ; - owl:onProperty :valueCreationDate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToUser ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasPermissions ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasOrder ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isDeleted ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deletedBy ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :previousValue ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasString ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasUUID ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - - rdfs:comment "The base class of classes representing Knora values"@en . diff --git a/upgrade/plugins/pr1367/knora-ontologies/salsah-gui.ttl b/upgrade/plugins/pr1367/knora-ontologies/salsah-gui.ttl deleted file mode 100644 index 6c183c0f51..0000000000 --- a/upgrade/plugins/pr1367/knora-ontologies/salsah-gui.ttl +++ /dev/null @@ -1,237 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix owl: . -@prefix rdf: . -@prefix xml: . -@prefix xsd: . -@prefix rdfs: . -@prefix knora-base: . -@prefix knora-admin: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The salsah-gui ontology"@en ; - - knora-base:attachedToProject knora-admin:SystemProject . - - -################################################################# -# -# Properties -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#guiOrder - -:guiOrder rdf:type owl:DatatypeProperty ; - - knora-base:subjectClassConstraint owl:Restriction ; - - knora-base:objectDatatypeConstraint xsd:nonNegativeInteger . - - - -### http://www.knora.org/ontology/salsah-gui#guiElement - -:guiElement rdf:type owl:ObjectProperty . - - - -### http://www.knora.org/ontology/salsah-gui#guiAttribute - -:guiAttribute rdf:type owl:DatatypeProperty ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/salsah-gui#guiAttributeDefinition - -:guiAttributeDefinition rdf:type owl:DatatypeProperty ; - - knora-base:subjectClassConstraint :Guielement ; - - knora-base:objectDatatypeConstraint xsd:string . - - - - - -################################################################# -# -# Classes -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#Guielement - -:Guielement rdf:type owl:Class . - - - - - -################################################################# -# -# Individuals -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#Colorpicker - -:Colorpicker rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "ncolors:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#Date - -:Date rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Geometry - -:Geometry rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Geonames - -:Geonames rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Iconclass - -# :Iconclass rdf:type :Guielement , -# owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Interval - -:Interval rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#List - -:List rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Pulldown - -:Pulldown rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Radio - -:Radio rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Richtext - -:Richtext rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Searchbox - -:Searchbox rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "numprops:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#SimpleText - -:SimpleText rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "size:integer" , - "maxlength:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#Slider - -:Slider rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "max(required):decimal" , - "min(required):decimal" . - - - -### http://www.knora.org/ontology/salsah-gui#Spinbox - -:Spinbox rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "max:decimal" , - "min:decimal" . - - - -### http://www.knora.org/ontology/salsah-gui#Textarea - -:Textarea rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "cols:integer" , - "rows:integer" , - "width:percent" , - "wrap:string(soft|hard)" . - - -### http://www.knora.org/ontology/salsah-gui#Checkbox - -:Checkbox rdf:type :Guielement , - owl:NamedIndividual . - - -### http://www.knora.org/ontology/salsah-gui#Fileupload - -:Fileupload rdf:type :Guielement , - owl:NamedIndividual . diff --git a/upgrade/plugins/pr1367/knora-ontologies/standoff-onto.ttl b/upgrade/plugins/pr1367/knora-ontologies/standoff-onto.ttl deleted file mode 100644 index f5113c5028..0000000000 --- a/upgrade/plugins/pr1367/knora-ontologies/standoff-onto.ttl +++ /dev/null @@ -1,356 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix xml: . -@prefix xsd: . -@prefix rdf: . -@prefix rdfs: . -@prefix owl: . -@prefix foaf: . -@prefix knora-base: . -@prefix knora-admin: . -@prefix salsah-gui: . -@base . - -@prefix : . - - rdf:type owl:Ontology ; - - rdfs:label "The standoff ontology"@en ; - - knora-base:attachedToProject knora-admin:SystemProject . - - -################################################################# -# -# Standoff Properties -# -################################################################# - -### http://www.knora.org/ontology/standoff#standoffRootTagHasDocumentType - -:standoffRootTagHasDocumentType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "describes the document type"@en ; - - knora-base:subjectClassConstraint :StandoffRootTag ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/standoff#standoffHyperlinkTagHasTarget - -:standoffHyperlinkTagHasTarget rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "describes the target settings of a hyperlink"@en ; - - knora-base:subjectClassConstraint :StandoffHyperlinkTag ; - - knora-base:objectDatatypeConstraint xsd:string . - - -################################################################# -# -# Intermediate Standoff Tags -# -################################################################# - -### http://www.knora.org/ontology/standoff#StandoffVisualTag - -:StandoffVisualTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag ; - - rdfs:comment "Represents visual markup information in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffStructuralTag - -:StandoffStructuralTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag ; - - rdfs:comment "Represents structural markup information in a TextValue"@en . - - -################################################################# -# -# Standoff Tags that can be instantiated -# -################################################################# - - -### http://www.knora.org/ontology/standoff#StandoffRootTag - -:StandoffRootTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffRootTagHasDocumentType ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents the root node if the TextValue has been created from XML"@en . - -### http://www.knora.org/ontology/standoff#StandoffHyperlinkTag - -:StandoffHyperlinkTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffUriTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffHyperlinkTagHasTarget ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a hyperlink in a text"@en . - -### http://www.knora.org/ontology/standoff#StandoffBlockquoteTag - -:StandoffBlockquoteTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a section that is quoted from another source in a text"@en . - - -### http://www.knora.org/ontology/standoff#StandoffCodeTag - -:StandoffCodeTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a section of computer source code in a text"@en . - - -### http://www.knora.org/ontology/standoff#StandoffParagraphTag - -:StandoffParagraphTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a paragraph in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader1Tag - -:StandoffHeader1Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 1 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader2Tag - -:StandoffHeader2Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 2 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader3Tag - -:StandoffHeader3Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 3 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader4Tag - -:StandoffHeader4Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 4 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader5Tag - -:StandoffHeader5Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 5 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader6Tag - -:StandoffHeader6Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 6 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffOrderedListTag - -:StandoffOrderedListTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents an ordered list in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffUnorderedListTag - -:StandoffUnorderedListTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents an unordered list in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffListElementTag - -:StandoffListElementTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a list element in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableBodyTag - -:StandoffTableBodyTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a table body in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableTag - -:StandoffTableTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a table in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableRowTag - -:StandoffTableRowTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a row in a table"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableCellTag - -:StandoffTableCellTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a cell in a table"@en . - - -### http://www.knora.org/ontology/standoff#StandoffBrTag - -:StandoffBrTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a linebreak"@en . - - - -### http://www.knora.org/ontology/standoff#StandoffItalicTag - -:StandoffItalicTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents italics in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffBoldTag - -:StandoffBoldTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents bold text in a TextValue"@en . - -### http://www.knora.org/ontology/standoff-html-editor#StandoffCiteTag - -:StandoffCiteTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents the title of a work in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffUnderlineTag - -:StandoffUnderlineTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents underlined text in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffStrikethroughTag - -:StandoffStrikethroughTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents struck text in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffSuperscriptTag - -:StandoffSuperscriptTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents superscript in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffSubscriptTag - -:StandoffSubscriptTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents subscript in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff-html-editor#StandoffLineTag - -:StandoffLineTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents a line to seperate content in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff-html-editor#StandoffPreTag - -:StandoffPreTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents a preformatted content in a TextValue"@en . diff --git a/upgrade/plugins/pr1367/test_1367.py b/upgrade/plugins/pr1367/test_1367.py deleted file mode 100644 index 3016d1f3e1..0000000000 --- a/upgrade/plugins/pr1367/test_1367.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright @ 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - - -import tempfile -import rdflib -from rdflib.term import URIRef, Literal -from rdflib.namespace import XSD -from plugins.pr1367.update import GraphTransformer - - -save_output = False - - -def test_update(): - input_graph = rdflib.Graph() - input_graph.parse("plugins/pr1367/test_data.ttl", format="turtle") - - transformer = GraphTransformer() - output_graph = transformer.transform(input_graph) - objects = list(output_graph.objects(URIRef("http://rdfh.ch/0001/thing-with-history/values/1"), URIRef("http://www.knora.org/ontology/knora-base#valueHasDecimal"))) - assert objects == [Literal("1.2", datatype=XSD.decimal)] - - if save_output: - temp_dir = tempfile.mkdtemp() - output_file_path = temp_dir + "/output.ttl" - output_graph.serialize(destination=output_file_path, format="turtle") - print("Wrote output to", output_file_path) diff --git a/upgrade/plugins/pr1367/test_data.ttl b/upgrade/plugins/pr1367/test_data.ttl deleted file mode 100644 index 36c6f863e8..0000000000 --- a/upgrade/plugins/pr1367/test_data.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . -@prefix owl: . -@prefix knora-base: . -@prefix knora-admin: . -@prefix anything: . - - a anything:Thing; - knora-base:isDeleted false; - knora-base:attachedToUser ; - knora-base:attachedToProject ; - rdfs:label "A thing with a decimal value"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:creationDate "2019-02-08T15:05:10Z"^^xsd:dateTime; - knora-base:lastModificationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; - anything:hasDecimal . - - a knora-base:DecimalValue; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-11T09:05:10Z"^^xsd:dateTime; - knora-base:valueHasDecimal "1.2"^^xsd:valueHasDecimal; - knora-base:valueHasOrder 0; - knora-base:valueHasString "1.2"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser . diff --git a/upgrade/plugins/pr1367/update.py b/upgrade/plugins/pr1367/update.py deleted file mode 100644 index affb017e1b..0000000000 --- a/upgrade/plugins/pr1367/update.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright @ 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - - -import rdflib -from rdflib.namespace import XSD -from updatelib import rdftools - - -# The incorrect IRI of xsd:valueHasDecimal. -xsd_value_has_decimal = rdflib.term.URIRef("http://www.w3.org/2001/XMLSchema#valueHasDecimal") - - -# Updates datatypes for PR 1367. -class GraphTransformer(rdftools.GraphTransformer): - def transform(self, graph): - output_graph = rdflib.Graph() - - for (s, p, o) in graph: - if o.__class__.__name__ == "Literal" and o.datatype == xsd_value_has_decimal: - new_o = rdflib.Literal(str(o), datatype=XSD.decimal) - output_graph.add((s, p, new_o)) - else: - output_graph.add((s, p, o)) - - return output_graph diff --git a/upgrade/plugins/pr1372/knora-ontologies/knora-admin.ttl b/upgrade/plugins/pr1372/knora-ontologies/knora-admin.ttl deleted file mode 100644 index c731a6f7e4..0000000000 --- a/upgrade/plugins/pr1372/knora-ontologies/knora-admin.ttl +++ /dev/null @@ -1,777 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix knora-base: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xml: . -@prefix xsd: . -@prefix foaf: . -@prefix dcterms: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The Knora admin ontology"@en ; - - knora-base:attachedToProject :SystemProject . - - -################################################################# -# -# Object Properties -# -################################################################# - - - -### http://www.knora.org/ontology/knora-admin#belongsToInstitution - -:belongsToInstitution rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates which Institution a project belongs to."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectClassConstraint :Institution . - - - -### http://www.knora.org/ontology/knora-admin#belongsToProject - -:belongsToProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates which project a group belongs to."@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#currentproject - -:currentproject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "This property indicates, which is the \"current project\" of a given user. A user can be part of any number of projects, but only one can be the active project."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#isInGroup - -:isInGroup rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given user is part of the given group."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :UserGroup . - - - -### http://www.knora.org/ontology/knora-admin#isInProject - -:isInProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given user is part of the given project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#isAdminForProject - -:isInProjectAdminGroup rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given user is part of the given project's ProjectAdmin group."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -################################################################# -# -# Datatype properties -# -################################################################# - - -### http://www.knora.org/ontology/knora-admin#address - -:address rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - knora-base:objectDatatypeConstraint xsd:string ; - - rdfs:comment "The address of a person or an institution"@en . - - -### http://www.knora.org/ontology/knora-admin#groupName - -:groupName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The group's name."@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectDatatypeConstraint xsd:string ; - - rdfs:subPropertyOf . - - - -### http://www.knora.org/ontology/knora-admin#groupDescription - -:groupDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of a user group"@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#hasSelfJoinEnabled - -:hasSelfJoinEnabled rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if users can add themselves to the project or group."@en ; - - # No knora-base:subjectClassConstraint, because this can be used with :knoraProject or :UserGroup. - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-admin#institutionName - -:institutionName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The institutions's name."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#institutionDescription - -:institutionDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of an institution."@en ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#institutionWebsite - -:institutionWebsite rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The URL of a web site."@en ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:anyURI . - - - -### http://www.knora.org/ontology/knora-admin#isActiveUser - -:isInSystemAdminGroup rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if the user is a member of the SystemAdmin group."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-admin#givenName - -:givenName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf foaf:givenName, :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The user's given name."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#familyName - -:familyName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf foaf:familyName, :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The user's family name."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#password - -:password rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "An encrypted credential for access"@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#phone - -:phone rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The phone number of a person, institution, etc."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#preferredLanguage - -:preferredLanguage rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The ISO 639-1 code of the user's preferred language."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectDescription - -:projectDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of a Knora project."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectKeyword - -:projectKeyword rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A keyword describing a project."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectLongname - -:projectLongname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The longname of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectLogo - -:projectLogo rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The path to the projects's logo."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectRestrictedViewSize - -:projectRestrictedViewSize rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The size of the image (as defined by IIIF) returned for restricted view."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectRestrictedViewWatermark - -:projectRestrictedViewWatermark rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The path to the restricted view watermark."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectShortname - -:projectShortname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The unique shortname of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectShortcode - -:projectShortcode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The unique short code of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#username - -:username rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The username and login name of a user."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#email - -:email rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The email address and login name of a user."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#status - -:status rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The status of the user / group / project. It is false if the entity has been deactivated (deleted)."@en ; - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -################################################################# -# -# Classes -# -################################################################# - - - -### http://www.knora.org/ontology/knora-admin#Institution - -:Institution rdf:type owl:Class ; - - rdfs:subClassOf foaf:Organization , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionDescription ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionWebsite ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :phone ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :address ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :email ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "An institution that has data in Knora."@en . - - - -### http://www.knora.org/ontology/knora-admin#User - -:User rdf:type owl:Class ; - - rdfs:subClassOf foaf:Person , - [ rdf:type owl:Restriction ; - owl:onProperty :username ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :email ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :familyName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :givenName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :password ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :preferredLanguage ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInProject ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInGroup ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInSystemAdminGroup ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a Knora user."@en . - - - -### http://www.knora.org/ontology/knora-admin#UserGroup - -:UserGroup rdf:type owl:Class ; - - rdfs:subClassOf foaf:Group , - [ rdf:type owl:Restriction ; - owl:onProperty :groupName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :groupDescription ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :belongsToProject ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:comment "A group of Knora users."@en . - - - - -### http://www.knora.org/ontology/knora-admin#knoraProject - -:knoraProject rdf:type owl:Class ; - - rdfs:subClassOf foaf:Project , - [ rdf:type owl:Restriction ; - owl:onProperty :projectShortname ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectShortcode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectLongname ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectDescription ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectKeyword ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectLogo ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectRestrictedViewSize ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectRestrictedViewWatermark ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :belongsToInstitution ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasSelfJoinEnabled ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a project that uses Knora."@en . - - - - -################################################################# -# -# Individuals -# -################################################################# - -### http://www.knora.org/ontology/knora-admin#UnknownUser -:UnknownUser rdf:type :UserGroup ; - :groupName "UnknownUser" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#KnownUser -:KnownUser rdf:type :UserGroup ; - :groupName "KnownUser" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#Creator -:Creator rdf:type :UserGroup ; - :groupName "Creator" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#ProjectMember -:ProjectMember rdf:type :UserGroup ; - :groupName "ProjectMember" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#ProjectAdmin -:ProjectAdmin rdf:type :UserGroup ; - :groupName "ProjectAdmin" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemAdmin -:SystemAdmin rdf:type :UserGroup ; - :groupName "SystemAdmin" ; - :belongsToProject :SystemProject ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemUser -:SystemUser rdf:type :User ; - rdfs:comment "A built-in system user."@en ; - :username "system"; - :email "system@localhost" ; - :givenName "Knora" ; - :familyName "System" ; - :password "-" ; - :status "true"^^xsd:boolean ; - :preferredLanguage "en" ; - :isInSystemAdminGroup "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#AnonymousUser -:AnonymousUser rdf:type :User ; - rdfs:comment "A built-in anonymous user."@en ; - :username "anonymous" ; - :email "anonymous@localhost" ; - :givenName "Knora" ; - :familyName "Anonymous" ; - :password "-" ; - :status "true"^^xsd:boolean ; - :preferredLanguage "en" ; - :isInSystemAdminGroup "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemProject -:SystemProject rdf:type :knoraProject ; - rdfs:comment "A built-in project representing the Knora System."@en ; - :projectShortname "SystemProject" ; - :projectShortcode "FFFF" ; - :projectLongname "Knora System Project" ; - :projectDescription "Knora System Project"@en ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - - -### http://www.knora.org/ontology/knora-admin#SharedOntologiesProject -:DefaultSharedOntologiesProject rdf:type :knoraProject ; - rdfs:comment "The default project for shared ontologies."@en ; - :projectShortname "DefaultSharedOntologiesProject" ; - :projectShortcode "0000" ; - :projectLongname "Knora Default Shared Ontologies Project" ; - :projectDescription "Knora Shared Ontologies Project"@en ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - -# -## -### Permission Class Properties -## -# -### http://www.knora.org/ontology/knora-admin#forProject - -:forProject rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a knoraProject."@en ; - knora-base:subjectClassConstraint :Permission ; - knora-base:objectClassConstraint :knoraProject . - -### http://www.knora.org/ontology/knora-admin#forGroup -:forGroup rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a UserGroup."@en ; - knora-base:subjectClassConstraint :Permission ; - knora-base:objectClassConstraint :UserGroup . - -### http://www.knora.org/ontology/knora-admin#forResourceClass -:forResourceClass rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a resource class."@en ; - knora-base:subjectClassConstraint :Permission . - -### http://www.knora.org/ontology/knora-admin#forProperty -:forProperty rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a resource property."@en ; - knora-base:subjectClassConstraint :Permission . - - -# -## -### Permission Class and Sub-Classes -## -# -### http://www.knora.org/ontology/knora-admin#Permission -:Permission rdf:type owl:Class ; - rdfs:comment "Base Permission class."@en. - - -### http://www.knora.org/ontology/knora-admin#AdministrativePermission -:AdministrativePermission rdf:type owl:Class ; - rdfs:comment "Administrative Permission class used to create instances for storing administrative permissions on groups."@en ; - rdfs:subClassOf :Permission . - -### http://www.knora.org/ontology/knora-admin#DefaultObjectAccessPermission -:DefaultObjectAccessPermission rdf:type owl:Class ; - rdfs:comment "Default Object Access Permission class used to create instances for storing default object access permission for a project and either groups, resource classes, or properties."@en ; - rdfs:subClassOf :Permission . diff --git a/upgrade/plugins/pr1372/knora-ontologies/knora-base.ttl b/upgrade/plugins/pr1372/knora-ontologies/knora-base.ttl deleted file mode 100644 index c6005e648d..0000000000 --- a/upgrade/plugins/pr1372/knora-ontologies/knora-base.ttl +++ /dev/null @@ -1,2710 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xml: . -@prefix xsd: . -@prefix foaf: . -@prefix dcterms: . -@prefix salsah-gui: . -@prefix knora-admin: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The Knora base ontology"@en ; - - :attachedToProject knora-admin:SystemProject ; - - :ontologyVersion "PR 1372" . - - - -################################################################# -# -# Properties -# -################################################################# - - - -### http://www.knora.org/ontology/knora-base#ontologyVersion - -:ontologyVersion rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates the version of the Knora built-in ontologies in a repository."@en ; - - :subjectClassConstraint owl:Ontology ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#isMainResource - -# This property is generated by a SPARQL CONSTRUCT query, it is not used in the triplestore and not used in the API - -:isMainResource rdf:type owl:DatatypeProperty ; - - rdfs:comment "Indicates if the given resource is the main resource of a request or a resource referred to by a link property."@en; - - :subjectClassConstraint :Resource ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#objectCannotBeMarkedAsDeleted - -:objectCannotBeMarkedAsDeleted rdf:type rdf:Property ; - - rdfs:comment "The base property of properties whose objects can't be marked as deleted"@en . - - - -### http://www.knora.org/ontology/knora-base#objectDatatypeConstraint - -:objectDatatypeConstraint rdf:type owl:DatatypeProperty ; - - rdfs:comment "Specifies the type required as the object of a datatype property"@en . - - - -### http://www.knora.org/ontology/knora-base#resourceIcon - -:resourceIcon rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint owl:Class ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#resourceProperty - -:resourceProperty rdf:type owl:ObjectProperty ; - - rdfs:comment "The base property of properties that point from Knora resources to Knora resources or values. These properties are required to have cardinalities in the resource classes in which they are used."@en ; - - :subjectClassConstraint :Resource . - - - -### http://www.knora.org/ontology/knora-base#subjectClassConstraint - -:subjectClassConstraint rdf:type owl:ObjectProperty ; - - rdfs:comment "Specifies the OWL class that the subject of a property must belong to"@en . - - - -### http://www.knora.org/ontology/knora-base#objectClassConstraint - -:objectClassConstraint rdf:type owl:ObjectProperty ; - - rdfs:comment "Specifies the OWL class that the object of a property must belong to"@en . - - - -### http://www.knora.org/ontology/knora-base#isEditable - -:isEditable rdf:type owl:AnnotationProperty ; - - :objectDatatypeConstraint xsd:boolean ; - - rdfs:label "is editable"@en ; - - rdfs:comment "Indicates whether a property's values can be updated via the Knora API."@en . - - - -### http://www.knora.org/ontology/knora-base#canBeInstantiated - -:canBeInstantiated rdf:type owl:AnnotationProperty ; - - :subjectClassConstraint owl:Class ; - - :objectDatatypeConstraint xsd:boolean ; - - rdfs:label "can be instantiated"@en ; - - rdfs:comment "Indicates whether a resource class can be instantiated via the Knora API."@en . - - - -### http://www.knora.org/ontology/knora-base#attachedToProject - -:attachedToProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "attached to project"@en ; - - rdfs:comment "Connects something to a project"@en ; - - :objectClassConstraint knora-admin:knoraProject . - - - -### http://www.knora.org/ontology/knora-base#attachedToUser - -:attachedToUser rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "attached to user"@en ; - - rdfs:comment "Connects something to a user"@en ; - - :objectClassConstraint knora-admin:User . - - -### http://www.knora.org/ontology/knora-base#hasColor - -:hasColor rdf:type owl:ObjectProperty ; - - rdfs:label "Farbe"@de , - "Color"@en , - "Couleur"@fr , - "Colore"@it ; - - rdfs:comment """Specifies the color of a region."""@en ; - - salsah-gui:guiAttribute "ncolors=8"^^xsd:string ; - - :objectClassConstraint :ColorValue ; - - :subjectClassConstraint :Region ; - - rdfs:subPropertyOf :hasValue ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Colorpicker . - - - -### http://www.knora.org/ontology/knora-base#hasComment - -:hasComment rdf:type owl:ObjectProperty ; - - rdfs:label "Kommentar"@de , - "Comment"@en , - "Commentaire"@fr , - "Commento"@it ; - - rdfs:comment """Represents a comment on a resource as a knora-base:TextValue"""@de ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :TextValue ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Richtext ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasExtResValue - -:hasExtResValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat externen Wert"@de , - "has external Value"@en , - "a valeur externe"@fr , - "ha valore esterno"@it ; - - :objectClassConstraint :ExternalResValue ; - - :subjectClassConstraint :ExternalResource ; - - rdfs:subPropertyOf :hasValue . - - -### http://www.knora.org/ontology/knora-base#hasFileValue - -:hasFileValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :FileValue ; - - rdfs:label "hat Datei"@de , - "has file"@en , - "a fichier"@fr , - "ha file"@it ; - - rdfs:comment "Connects a Representation to a file"@en ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - :subjectClassConstraint :Representation ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasStillImageFileValue - -:hasStillImageFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Bilddatei"@de , - "has image file"@en , - "a fichier d'image"@fr , - "ha file imagine"@it ; - - rdfs:comment "Connects a Representation to an image file"@en ; - - :objectClassConstraint :StillImageFileValue ; - - :subjectClassConstraint :StillImageRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasMovingImageFileValue - -:hasMovingImageFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Filmdatei"@de , - "has movie file"@en , - "a fichier de film"@fr , - "ha file film"@it ; - - rdfs:comment "Connects a Representation to a movie file"@en ; - - :objectClassConstraint :MovingImageFileValue ; - - :subjectClassConstraint :MovingImageRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasAudioFileValue - -:hasAudioFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Audiodatei"@de , - "has audio file"@en , - "a fichier d'audio"@fr , - "ha file audio"@it ; - - rdfs:comment "Connects a Representation to an audio file"@en ; - - :objectClassConstraint :AudioFileValue ; - - :subjectClassConstraint :AudioRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasDDDFileValue - -:hasDDDFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat 3D-Datei"@de , - "has 3D-file"@en , - "a ficher de 3D"@fr , - "ha file 3D"@it ; - - rdfs:comment "Connects a Representation to a 3D-file"@en ; - - :objectClassConstraint :DDDFileValue ; - - :subjectClassConstraint :DDDRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasTextFileValue - -:hasTextFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Textdatei"@de , - "has text file"@en , - "a fichier de texte"@fr , - "ha file testo"@it ; - - rdfs:comment "Connects a Representation to a text file"@en ; - - :objectClassConstraint :TextFileValue ; - - :subjectClassConstraint :TextRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasDocumentFileValue - -:hasDocumentFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Dokument"@de , - "has document"@en , - "a document"@fr , - "ha documento"@it ; - - rdfs:comment "Connects a Representation to a document"@en ; - - :objectClassConstraint :DocumentFileValue ; - - :subjectClassConstraint :DocumentRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasGeometry - -:hasGeometry rdf:type owl:ObjectProperty ; - - rdfs:label "Geometrie"@de , - "Geometry"@en , - "Géometrie"@fr , - "Geometria"@it ; - - rdfs:comment """Represents a geometrical shape."""@en ; - - rdfs:subPropertyOf :hasValue ; - - salsah-gui:guiElement salsah-gui:Geometry ; - - :isEditable true ; - - :objectClassConstraint :GeomValue ; - - :subjectClassConstraint :Region . - - - -### http://www.knora.org/ontology/knora-base#hasLinkTo - -:hasLinkTo rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :resourceProperty ; - - rdfs:label "hat Link zu"@de , - "has Link to"@en , - "a lien vers"@fr , - "ha Link verso"@it ; - - rdfs:comment "Represents a direct connection between two resources"@en ; - - :isEditable true ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :Resource . - - - -### http://www.knora.org/ontology/knora-base#hasLinkToValue - -:hasLinkToValue rdf:type owl:ObjectProperty ; - - rdfs:comment "Points to a LinkValue reification describing a link between two resources"@en ; - - rdfs:label "hat Link zu"@de , - "has Link to"@en , - "a lien vers"@fr , - "ha Link verso"@it ; - - rdfs:comment "Represents a direct connection between two resources"@en ; - - :isEditable true ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasRepresentation - -:hasRepresentation rdf:type owl:ObjectProperty ; - - rdfs:label "hat Repräsentation"@de , - "has Representation"@en , - "a Répresentation"@fr , - "ha Rappresentazione"@it ; - - rdfs:comment "References an instance of a Representation. A Representation contains the metadata of a digital object (= file) which represents some physical entity such as an image, a sound, an encoded text etc."@en ; - - :objectClassConstraint :Representation ; - - :subjectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#hasRepresentationValue - -:hasRepresentationValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - - -### http://www.knora.org/ontology/knora-base#hasStandoffLinkTo - -:hasStandoffLinkTo rdf:type owl:ObjectProperty ; - - rdfs:label "hat Standoff Link zu"@de , - "has Standoff Link to"@en , - "a standoff lien vers"@fr , - "ha standoff link verso"@it ; - - rdfs:comment "Repräsentiert einen Link im Standoff Markup von einer Ressource zu einer anderen"@de , - "Represents a link in standoff markup from one resource to another."@en ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#hasStandoffLinkToValue - -:hasStandoffLinkToValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Standoff Link zu"@de , - "has Standoff Link to"@en , - "a standoff lien vers"@fr , - "ha standoff link verso"@it ; - - rdfs:comment "Repräsentiert einen Link im Standoff Markup von einer Ressource zu einer anderen"@de , - "Represents a link in standoff markup from one resource to another."@en ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#standoffTagHasLink - -:standoffTagHasLink rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :StandoffLinkTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasInternalReference - -:standoffTagHasInternalReference rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :StandoffTag ; - - :subjectClassConstraint :StandoffInternalReferenceTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStart - -:standoffTagHasStart rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEnd - -:standoffTagHasEnd rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartIndex - -:standoffTagHasStartIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEndIndex - -:standoffTagHasEndIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartAncestor - -:standoffTagHasStartAncestor rdf:type owl:ObjectProperty, owl:TransitiveProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartParent - -:standoffTagHasStartParent rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted, :standoffTagHasStartAncestor ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEndParent - -:standoffTagHasEndParent rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasUUID - -:standoffTagHasUUID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:string . - - -:valueHasMaxStandoffStartIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#hasSubListNode - -:hasSubListNode rdf:type owl:ObjectProperty ; - - rdfs:comment "A hierarchical list is formed using the \"hasSubListNode\"-property"@en ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :ListNode ; - - :subjectClassConstraint :ListNode . - - -### http://www.knora.org/ontology/knora-base#hasValue - -:hasValue rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :resourceProperty ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :Value . - - -### http://www.knora.org/ontology/knora-base#isAnnotationOf - -:isAnnotationOf rdf:type owl:ObjectProperty ; - - rdfs:label "ist Annotation von"@de , - "is Annotation of"@en , - "est Annotation de"@fr , - "è Annotation di"@it ; - - :subjectClassConstraint :Annotation ; - - :objectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isAnnotationOfValue - -:isAnnotationOfValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Annotation ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#isPartOf - -:isPartOf rdf:type owl:ObjectProperty ; - - rdfs:label "ist Teil von"@de , - "is part of"@en , - "fait partie de"@fr , - "fa parte di"@it ; - - rdfs:comment "Indicates that this resource is part of another resource"@en ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isPartOfValue - -:isPartOfValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#isRegionOf - -:isRegionOf rdf:type owl:ObjectProperty ; - - rdfs:comment "Region of interest within a digital object (e.g. an image)"@en ; - - rdfs:label "is Region von"@de , - "is region of"@en , - "est région de"@fr , - "è regione di"@it ; - - :subjectClassConstraint :Region ; - - :objectClassConstraint :Representation ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isRegionOfValue - -:isRegionOfValue rdf:type owl:ObjectProperty ; - - rdfs:comment "Region of interest within a digital object (e.g. an image)"@en ; - - rdfs:label "is Region von"@de , - "is region of"@en , - "est région de"@fr , - "è regione di"@it ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Region ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#previousValue - -:previousValue rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "Points to the previous verson of a value"@en ; - - :subjectClassConstraint :Value ; - - :objectClassConstraint :Value . - - - -### http://www.knora.org/ontology/knora-base#seqnum - -:seqnum rdf:type owl:ObjectProperty ; - - :objectClassConstraint :IntValue ; - - rdfs:subPropertyOf :hasValue ; - - rdfs:label "Sequenznummer"@de , - "Sequence number"@en , - "Numéro de séquence"@fr , - "Numero di sequenza"@it ; - - rdfs:comment "Indicates the position of a resource within a sequence"@en . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasOriginalXMLID - -:standoffTagHasOriginalXMLID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:string ; - - :subjectClassConstraint :StandoffTag . - - - -### http://www.knora.org/ontology/knora-base#valueHasStandoff - -:valueHasStandoff rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :objectClassConstraint :StandoffTag ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#valueHasLanguage - -:valueHasLanguage rdf:type owl:DatatypeProperty ; - - :objectDatatypeConstraint xsd:string ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#valueHasMapping - -:valueHasMapping rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :objectClassConstraint :XMLToStandoffMapping ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#hasMappingElement - -:hasMappingElement rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "mapping element"@en ; - - rdfs:comment """Represents an element in a mapping"""@en ; - - :subjectClassConstraint :XMLToStandoffMapping ; - - :objectClassConstraint :MappingElement . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLTagname - -:mappingHasXMLTagname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML tag"@en ; - - rdfs:comment """name of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLNamespace - -:mappingHasXMLNamespace rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "namespace of the XML tag"@en ; - - rdfs:comment """namespace of the XML tag"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLClass - -:mappingHasXMLClass rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "class of the XML tag"@en ; - - rdfs:comment """class of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffClass - -:mappingHasStandoffClass rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "IRI of the standoff class"@en ; - - rdfs:comment """IRI of the standoff class"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectClassConstraint owl:Class . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLAttribute - -:mappingHasXMLAttribute rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML attribute"@en ; - - rdfs:comment """name of the XML attribute"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectClassConstraint :MappingXMLAttribute . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLAttributename - -:mappingHasXMLAttributename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML attribute"@en ; - - rdfs:comment """name of the XML attribute"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffProperty - -:mappingHasStandoffProperty rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "IRI of the standoff property"@en ; - - rdfs:comment """IRI of the standoff property"""@en ; - - :subjectClassConstraint :MappingXMLAttribute . - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffDataTypeClass - -:mappingHasStandoffDataTypeClass rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "datatype of the XML tag"@en ; - - rdfs:comment """datatype of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectClassConstraint :MappingStandoffDataTypeClass . - - -### http://www.knora.org/ontology/knora-base#mappingElementRequiresSeparator - -:mappingElementRequiresSeparator rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "indicates if the element requires a separator in the text"@en ; - - rdfs:comment """indicates if the element requires a separator in the text"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:boolean . - - -### http://www.knora.org/ontology/knora-base#mappingHasDefaultXSLTransformation - -:mappingHasDefaultXSLTransformation rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "default XSL Transformation"@en ; - - rdfs:comment """default XSL Transformation for this mapping"""@en ; - - :subjectClassConstraint :XMLToStandoffMapping ; - - :objectClassConstraint :XSLTransformation . - - -### http://www.knora.org/ontology/knora-base#deletedBy - -:deletedBy rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates who deleted a resource or value"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectClassConstraint knora-admin:User . - - -################################################################# -# -# Datatype properties -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#creationDate - -:creationDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates when a resource was created"@en ; - - :subjectClassConstraint :Resource ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#deleteDate - -:deleteDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates when a resource or value was deleted"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:dateTime . - - -### http://www.knora.org/ontology/knora-base#dimX - -:dimX rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :FileValue ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#dimY - -:dimY rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :FileValue ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#duration - -:duration rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#extResAccessInfo - -:extResAccessInfo rdf:type owl:DatatypeProperty ; - - rdfs:comment "Information (URL etc.) for accessing an external resource"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#extResId - -:extResId rdf:type owl:DatatypeProperty ; - - rdfs:comment "The ID of the external resource. The form of the ID is dependent on the provider."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#extResProvider - -:extResProvider rdf:type owl:DatatypeProperty ; - - rdfs:comment "The name of the external provider of the resource"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - - -### http://www.knora.org/ontology/knora-base#fps - -:fps rdf:type owl:DatatypeProperty ; - - rdfs:label "Frames per second"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :MovingImageFileValue ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#internalFilename - -:internalFilename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#internalMimeType - -:internalMimeType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#isDeleted - -:isDeleted rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if the resource has been deleted"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#isRootNode - -:isRootNode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#hasRootNode - -:hasRootNode rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint :ListNode . - - - - -### http://www.knora.org/ontology/knora-base#lastModificationDate - -:lastModificationDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#listNodePosition - -:listNodePosition rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#listNodeName - -:listNodeName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#originalFilename - -:originalFilename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#originalMimeType - -:originalMimeType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasComment - -:valueHasComment rdf:type owl:DatatypeProperty ; - - rdfs:comment "A comment on a value"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#deleteComment - -:deleteComment rdf:type owl:DatatypeProperty ; - - rdfs:comment "A comment explaining why a resource or value was marked as deleted"@en ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueCreationDate - -:valueCreationDate rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :Value ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#valueHas - -:valueHas rdf:type rdf:Property ; - - :subjectClassConstraint :ValueBase ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted . - - - -### http://www.knora.org/ontology/knora-base#valueHasUUID - -:valueHasUUID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "The UUID of a value"@en ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasCalendar - -:valueHasCalendar rdf:type owl:DatatypeProperty ; - - rdfs:comment "Name of the calendar to be used, such as \"GREGORIAN\" or \"JULIAN\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasColor - -:valueHasColor rdf:type owl:DatatypeProperty ; - - rdfs:comment "Color in the form of #rrggbb (as defining web colors)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ColorBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasEndJDN - -:valueHasEndJDN rdf:type owl:DatatypeProperty ; - - rdfs:comment "Contains the end of a date as a Julian Day Number (JDN)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasEndPrecision - -:valueHasEndPrecision rdf:type owl:DatatypeProperty ; - - rdfs:comment "Precision of knowledge about the end of the date. Allowed are \"DAY\", \"MONTH\" or \"YEAR\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasDecimal - -:valueHasDecimal rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DecimalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasGeometry - -:valueHasGeometry rdf:type owl:DatatypeProperty ; - - rdfs:comment "JSON string describing a geometry (e.g. a region). Currently geometries are limited to 2D unions of primitive objects like circles, squares and polygons."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :GeomValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasGeonameCode - -:valueHasGeonameCode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :GeonameValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasInteger - -:valueHasInteger rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasBoolean - -:valueHasBoolean rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :BooleanBase ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#valueHasUri - -:valueHasUri rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :UriBase ; - - :objectDatatypeConstraint xsd:anyURI . - - - -### http://www.knora.org/ontology/knora-base#valueHasIntervalEnd - -:valueHasIntervalEnd rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntervalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasIntervalStart - -:valueHasIntervalStart rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntervalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasListNode - -:valueHasListNode rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ListValue ; - - :objectClassConstraint :ListNode . - - - -### http://www.knora.org/ontology/knora-base#valueHasOrder - -:valueHasOrder rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#valueHasRefCount - -:valueHasRefCount rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :LinkValue ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasStartJDN - -:valueHasStartJDN rdf:type owl:DatatypeProperty ; - - rdfs:comment "Contains the start of a date as a Julian Day Number (JDN)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasStartPrecision - -:valueHasStartPrecision rdf:type owl:DatatypeProperty ; - - rdfs:comment "The precision the start of a date. Allowed values are \"DAY\", \"MONTH\", or \"YEAR\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasString - -:valueHasString rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "A string representation of a value, required for full-text searches and search results."@en ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#hasPermissions - -:hasPermissions rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:string . - - - -################################################################# -# -# Classes -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#Annotation - -:Annotation rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isAnnotationOf ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isAnnotationOfValue ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Annotation"@de , - "Annotation"@en , - "Annotation"@fr , - "Annotation"@it ; - - :canBeInstantiated true ; - - rdfs:comment "A generic class for representing annotations"@en . - - - -### http://www.knora.org/ontology/knora-base#AudioFileValue - -:AudioFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :duration ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents an audio file"@en . - - - -### http://www.knora.org/ontology/knora-base#AudioRepresentation - -:AudioRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasAudioFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Audio)"@de , - "Representation (Audio)"@en , - "Répresentation (Audio)"@fr , - "Rappresentazione (Audio)"@it ; - - rdfs:comment "Represents a file containing audio data"@en . - - -### http://www.knora.org/ontology/knora-base#ColorBase - -:ColorBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasColor ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#ColorValue - -:ColorValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :ColorBase ; - - rdfs:comment "Represents a color in HTML format, e.g. \"#33eeff\""@en . - - - -### http://www.knora.org/ontology/knora-base#DDDFileValue - -:DDDFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue ; - - rdfs:comment "This represents some 3D-object with mesh data, point cloud, etc."@en . - - - -### http://www.knora.org/ontology/knora-base#DDDRepresentation - -:DDDRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasDDDFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (3D)"@de , - "Representation (3D)"@en , - "Répresentation (3D)"@fr , - "Rappresentazione (3D)"@it ; - - rdfs:comment "Represents a file containg 3D data"@en . - - -### http://www.knora.org/ontology/knora-base#DateBase - -:DateBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasCalendar ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasEndPrecision ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasEndJDN ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStartPrecision ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStartJDN ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#DateValue - -:DateValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :DateBase ; - - rdfs:comment "Represents a Knora date value"@en . - - - -### http://www.knora.org/ontology/knora-base#DocumentFileValue - -:DocumentFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue . - - - -### http://www.knora.org/ontology/knora-base#DocumentRepresentation - -:DocumentRepresentation rdf:type owl:Class ; - - rdfs:label "Repräsentation (Dokument)"@de , - "Representation (Document)"@en , - "Répresentation (Document)"@fr , - "Rappresentazione (Documento)"@it ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasDocumentFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ExternalResValue - -:ExternalResValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :extResId ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :extResProvider ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :extResAccessInfo ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ExternalResource - -:ExternalResource rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasExtResValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Externe Ressource"@de , - "External Resource"@en , - "Ressource Externe"@fr , - "Risorsa esterna"@it ; - - rdfs:comment "Represents a proxy for an object stored by an external provider"@en . - - - -### http://www.knora.org/ontology/knora-base#FileValue - -:FileValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :originalMimeType ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :internalFilename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :internalMimeType ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :originalFilename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#DecimalBase - -:DecimalBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasDecimal ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#DecimalValue - -:DecimalValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :DecimalBase ; - - rdfs:comment "Represents an arbitrary-precision decimal value"@en . - - - -### http://www.knora.org/ontology/knora-base#GeomValue - -:GeomValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasGeometry ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a geometrical objects as JSON string"@en . - - - -### http://www.knora.org/ontology/knora-base#GeonameValue - -:GeonameValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasGeonameCode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#IntBase - -:IntBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasInteger ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#IntValue - -:IntValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :IntBase ; - - rdfs:comment "Represents an integer value"@en . - -### http://www.knora.org/ontology/knora-base#BooleanBase - -:BooleanBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasBoolean ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#BooleanValue - -:BooleanValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :BooleanBase ; - - rdfs:comment "Represents a boolean value"@en . - - - -### http://www.knora.org/ontology/knora-base#UriBase - -:UriBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasUri ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - -### http://www.knora.org/ontology/knora-base#UriValue - -:UriValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :UriBase ; - - rdfs:comment "Represents a URI"@en . - -### http://www.knora.org/ontology/knora-base#IntervalBase - -:IntervalBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasIntervalEnd ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasIntervalStart ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#IntervalValue - -:IntervalValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :IntervalBase ; - - rdfs:comment "Represents a time interval, e.g. in an audio recording"@en . - - - -### http://www.knora.org/ontology/knora-base#LinkObj - -:LinkObj rdf:type owl:Class ; - - rdfs:label "Verknüpfungsobjekt"@de , - "Link Object"@en , - "Objet de lien"@fr , - "Oggetto di connessione"@it ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasLinkTo ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasLinkToValue ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - :resourceIcon "link.gif"^^xsd:string ; - - :canBeInstantiated true ; - - rdfs:comment "Verknüpfung mehrerer Resourcen"@de , - "Represents a generic link object"@en . - - - -### http://www.knora.org/ontology/knora-base#LinkValue - -:LinkValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - rdf:Statement , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasRefCount ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:subject ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:predicate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:object ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "A reification node that describes direct links between resources"@en . - - - -### http://www.knora.org/ontology/knora-base#ListNode - -:ListNode rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :hasSubListNode ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :listNodePosition ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :listNodeName ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRootNode ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasRootNode ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToProject ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdfs:label ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:comment "Represents a flat or hierarchical list"@en . - - - -### http://www.knora.org/ontology/knora-base#ListValue - -:ListValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasListNode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#MovingImageFileValue - -:MovingImageFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :dimX ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :dimY ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :fps ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :duration ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a moving image file"@en . - - - -### http://www.knora.org/ontology/knora-base#MovingImageRepresentation - -:MovingImageRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasMovingImageFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Video)"@de , - "Representation (Movie)"@en , - "Répresentation (Film)"@fr , - "Rappresentazione (Film)"@it ; - - rdfs:comment "A resource containing moving image data"@en . - - - -### http://www.knora.org/ontology/knora-base#Region - -:Region rdf:type owl:Class ; - - rdfs:label "Region"@de , - "Region"@en , - "Région"@fr , - "Regione"@it ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasColor ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRegionOf ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasGeometry ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRegionOfValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - :resourceIcon "region.gif"^^xsd:string ; - - :canBeInstantiated true ; - - rdfs:comment "Represents a geometric region of a resource. The geometry is represented currently as JSON string."@en . - - - -### http://www.knora.org/ontology/knora-base#Representation - -:Representation rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation"@de , - "Representation"@en , - "Répresentation"@fr , - "Rappresentazione"@it ; - - rdfs:comment "A resource that can store a file"@en . - - - -### http://www.knora.org/ontology/knora-base#Resource - -:Resource rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty rdfs:label ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isDeleted ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStandoffLinkTo ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStandoffLinkToValue ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToUser ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToProject ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasPermissions ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :creationDate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :lastModificationDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deletedBy ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Ressource"@de , - "Resource"@en , - "Ressource"@fr , - "Risorsa"@it ; - - rdfs:comment "Represents something in the world, or an abstract thing"@en . - - -################################################################# -# -# Generic Standoff Tag -# -################################################################# - - -:standoffParentClassConstraint rdf:type owl:ObjectProperty . - - -### http://www.knora.org/ontology/knora-base#StandoffTag - -:StandoffTag rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStart ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEnd ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasUUID ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasOriginalXMLID ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStartIndex ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEndIndex ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStartParent ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEndParent ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffParentClassConstraint; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a standoff markup tag"@en . - - - -################################################################# -# -# Abstract Standoff Data Type Tag -# -################################################################# - -### http://www.knora.org/ontology/knora-base#StandoffDataTypeTag - -:StandoffDataTypeTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffTag ; - - rdfs:comment "Represents a knora-base value type in a TextValue"@en . - - -################################################################# -# -# Standoff Data Type Tags that can be instantiated -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#StandoffLinkTag - -:StandoffLinkTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasLink ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a reference to a Knora resource in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffUriTag - -:StandoffUriTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag , - :UriBase ; - - rdfs:comment "Represents an arbitrary URI in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffDateTag - -:StandoffDateTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :DateBase ; - - rdfs:comment "Represents a date in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffColorTag - -:StandoffColorTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :ColorBase ; - - rdfs:comment "Represents a color in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffIntegerTag - -:StandoffIntegerTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :IntBase ; - - rdfs:comment "Represents an integer value in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffDecimalTag - -:StandoffDecimalTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :DecimalBase ; - - rdfs:comment "Represents a decimal (floating point) value in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffIntervalTag - -:StandoffIntervalTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :IntervalBase ; - - rdfs:comment "Represents an interval in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffBooleanTag - -:StandoffBooleanTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :BooleanBase ; - - rdfs:comment "Represents a boolean in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffInternalReferenceTag - -:StandoffInternalReferenceTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :ValueBase, - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasInternalReference ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents an internal reference in a TextValue"@en . - - - -### http://www.knora.org/ontology/knora-base#StillImageFileValue - -:StillImageFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :dimY ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :dimX ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "A file containing a two-dimensional still image"@en . - - - -### http://www.knora.org/ontology/knora-base#StillImageRepresentation - -:StillImageRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStillImageFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Bild)"@de , - "Representation (Image)"@en , - "Répresentation (Image)"@fr , - "Rappresentazione (Imagine)"@it ; - - rdfs:comment "A resource that can contain a two-dimensional still image file"@en . - - - -### http://www.knora.org/ontology/knora-base#TextFileValue - -:TextFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue ; - - rdfs:comment "A text file such as plain Unicode text, LaTeX, TEI/XML, etc."@en . - - - -### http://www.knora.org/ontology/knora-base#TextRepresentation - -:TextRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasTextFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Text)"@de , - "Representation (Text)"@en , - "Répresentation (Texte)"@fr , - "Rappresentazione (testo)"@it ; - - rdfs:comment "A resource containing a text file"@en . - - -### http://www.knora.org/ontology/knora-base#ForbiddenResource - -:ForbiddenResource rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ]; - - rdfs:label """A ForbiddenResource is a proxy for a resource that the client has insufficient permissions to see."""@en ; - - rdfs:comment """A ForbiddenResource is a proxy for a resource that the client has insufficient permissions to see."""@en . - -### http://www.knora.org/ontology/knora-base#XSLTransformation - -:XSLTransformation rdf:type owl:Class ; - - rdfs:subClassOf :TextRepresentation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasTextFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "a TextRepresentation representing an XSL transformation that can be applied to an XML created from standoff. The transformation's result is ecptected to be HTML."@en ; - - rdfs:comment "a TextRepresentation representing an XSL transformation that can be applied to an XML created from standoff. The transformation's result is ecptected to be HTML."@en . - - -### http://www.knora.org/ontology/knora-base#MappingComponent - -:MappingComponent rdf:type owl:Class ; - - rdfs:label "Component of a mapping"@en ; - - rdfs:comment "Component of a mapping" . - - -### http://www.knora.org/ontology/knora-base#MappingStandoffDataTypeClass - -:MappingStandoffDataTypeClass rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttributename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffClass ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML attributes to standoff properties"@en ; - - rdfs:comment "Mapping from XML attributes to standoff properties" . - - -### http://www.knora.org/ontology/knora-base#MappingXMLAttribute - -:MappingXMLAttribute rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttributename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLNamespace ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffProperty ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML attributes to standoff properties"@en ; - - rdfs:comment "Mapping from XML attributes to standoff properties" . - - -### http://www.knora.org/ontology/knora-base#MappingElement - -:MappingElement rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLTagname ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLNamespace ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLClass ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffClass ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttribute ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffDataTypeClass ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingElementRequiresSeparator ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML to standoff entities"@en ; - - rdfs:comment "Mapping from XML to standoff entities" . - -### http://www.knora.org/ontology/knora-base#XMLToStandoffMapping - -:XMLToStandoffMapping rdf:type owl:Class ; - - rdfs:subClassOf - [ rdf:type owl:Restriction ; - owl:onProperty :hasMappingElement ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasDefaultXSLTransformation ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Mapping from XML to standoff entities"@en ; - - rdfs:comment "Mapping from XML to standoff entities" . - -### http://www.knora.org/ontology/knora-base#TextValue - -:TextValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStandoff ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasMaxStandoffStartIndex ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasLanguage ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasMapping ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ValueBase - -:ValueBase rdf:type owl:Class . - - -### http://www.knora.org/ontology/knora-base#Value - -:Value rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase, - [ rdf:type owl:Restriction ; - owl:onProperty :valueCreationDate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToUser ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasPermissions ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasOrder ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isDeleted ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deletedBy ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :previousValue ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasString ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasUUID ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - - rdfs:comment "The base class of classes representing Knora values"@en . diff --git a/upgrade/plugins/pr1372/knora-ontologies/salsah-gui.ttl b/upgrade/plugins/pr1372/knora-ontologies/salsah-gui.ttl deleted file mode 100644 index 6c183c0f51..0000000000 --- a/upgrade/plugins/pr1372/knora-ontologies/salsah-gui.ttl +++ /dev/null @@ -1,237 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix owl: . -@prefix rdf: . -@prefix xml: . -@prefix xsd: . -@prefix rdfs: . -@prefix knora-base: . -@prefix knora-admin: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The salsah-gui ontology"@en ; - - knora-base:attachedToProject knora-admin:SystemProject . - - -################################################################# -# -# Properties -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#guiOrder - -:guiOrder rdf:type owl:DatatypeProperty ; - - knora-base:subjectClassConstraint owl:Restriction ; - - knora-base:objectDatatypeConstraint xsd:nonNegativeInteger . - - - -### http://www.knora.org/ontology/salsah-gui#guiElement - -:guiElement rdf:type owl:ObjectProperty . - - - -### http://www.knora.org/ontology/salsah-gui#guiAttribute - -:guiAttribute rdf:type owl:DatatypeProperty ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/salsah-gui#guiAttributeDefinition - -:guiAttributeDefinition rdf:type owl:DatatypeProperty ; - - knora-base:subjectClassConstraint :Guielement ; - - knora-base:objectDatatypeConstraint xsd:string . - - - - - -################################################################# -# -# Classes -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#Guielement - -:Guielement rdf:type owl:Class . - - - - - -################################################################# -# -# Individuals -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#Colorpicker - -:Colorpicker rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "ncolors:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#Date - -:Date rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Geometry - -:Geometry rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Geonames - -:Geonames rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Iconclass - -# :Iconclass rdf:type :Guielement , -# owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Interval - -:Interval rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#List - -:List rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Pulldown - -:Pulldown rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Radio - -:Radio rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Richtext - -:Richtext rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Searchbox - -:Searchbox rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "numprops:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#SimpleText - -:SimpleText rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "size:integer" , - "maxlength:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#Slider - -:Slider rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "max(required):decimal" , - "min(required):decimal" . - - - -### http://www.knora.org/ontology/salsah-gui#Spinbox - -:Spinbox rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "max:decimal" , - "min:decimal" . - - - -### http://www.knora.org/ontology/salsah-gui#Textarea - -:Textarea rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "cols:integer" , - "rows:integer" , - "width:percent" , - "wrap:string(soft|hard)" . - - -### http://www.knora.org/ontology/salsah-gui#Checkbox - -:Checkbox rdf:type :Guielement , - owl:NamedIndividual . - - -### http://www.knora.org/ontology/salsah-gui#Fileupload - -:Fileupload rdf:type :Guielement , - owl:NamedIndividual . diff --git a/upgrade/plugins/pr1372/knora-ontologies/standoff-onto.ttl b/upgrade/plugins/pr1372/knora-ontologies/standoff-onto.ttl deleted file mode 100644 index f5113c5028..0000000000 --- a/upgrade/plugins/pr1372/knora-ontologies/standoff-onto.ttl +++ /dev/null @@ -1,356 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix xml: . -@prefix xsd: . -@prefix rdf: . -@prefix rdfs: . -@prefix owl: . -@prefix foaf: . -@prefix knora-base: . -@prefix knora-admin: . -@prefix salsah-gui: . -@base . - -@prefix : . - - rdf:type owl:Ontology ; - - rdfs:label "The standoff ontology"@en ; - - knora-base:attachedToProject knora-admin:SystemProject . - - -################################################################# -# -# Standoff Properties -# -################################################################# - -### http://www.knora.org/ontology/standoff#standoffRootTagHasDocumentType - -:standoffRootTagHasDocumentType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "describes the document type"@en ; - - knora-base:subjectClassConstraint :StandoffRootTag ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/standoff#standoffHyperlinkTagHasTarget - -:standoffHyperlinkTagHasTarget rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "describes the target settings of a hyperlink"@en ; - - knora-base:subjectClassConstraint :StandoffHyperlinkTag ; - - knora-base:objectDatatypeConstraint xsd:string . - - -################################################################# -# -# Intermediate Standoff Tags -# -################################################################# - -### http://www.knora.org/ontology/standoff#StandoffVisualTag - -:StandoffVisualTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag ; - - rdfs:comment "Represents visual markup information in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffStructuralTag - -:StandoffStructuralTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag ; - - rdfs:comment "Represents structural markup information in a TextValue"@en . - - -################################################################# -# -# Standoff Tags that can be instantiated -# -################################################################# - - -### http://www.knora.org/ontology/standoff#StandoffRootTag - -:StandoffRootTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffRootTagHasDocumentType ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents the root node if the TextValue has been created from XML"@en . - -### http://www.knora.org/ontology/standoff#StandoffHyperlinkTag - -:StandoffHyperlinkTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffUriTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffHyperlinkTagHasTarget ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a hyperlink in a text"@en . - -### http://www.knora.org/ontology/standoff#StandoffBlockquoteTag - -:StandoffBlockquoteTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a section that is quoted from another source in a text"@en . - - -### http://www.knora.org/ontology/standoff#StandoffCodeTag - -:StandoffCodeTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a section of computer source code in a text"@en . - - -### http://www.knora.org/ontology/standoff#StandoffParagraphTag - -:StandoffParagraphTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a paragraph in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader1Tag - -:StandoffHeader1Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 1 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader2Tag - -:StandoffHeader2Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 2 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader3Tag - -:StandoffHeader3Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 3 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader4Tag - -:StandoffHeader4Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 4 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader5Tag - -:StandoffHeader5Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 5 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader6Tag - -:StandoffHeader6Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 6 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffOrderedListTag - -:StandoffOrderedListTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents an ordered list in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffUnorderedListTag - -:StandoffUnorderedListTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents an unordered list in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffListElementTag - -:StandoffListElementTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a list element in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableBodyTag - -:StandoffTableBodyTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a table body in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableTag - -:StandoffTableTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a table in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableRowTag - -:StandoffTableRowTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a row in a table"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableCellTag - -:StandoffTableCellTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a cell in a table"@en . - - -### http://www.knora.org/ontology/standoff#StandoffBrTag - -:StandoffBrTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a linebreak"@en . - - - -### http://www.knora.org/ontology/standoff#StandoffItalicTag - -:StandoffItalicTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents italics in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffBoldTag - -:StandoffBoldTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents bold text in a TextValue"@en . - -### http://www.knora.org/ontology/standoff-html-editor#StandoffCiteTag - -:StandoffCiteTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents the title of a work in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffUnderlineTag - -:StandoffUnderlineTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents underlined text in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffStrikethroughTag - -:StandoffStrikethroughTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents struck text in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffSuperscriptTag - -:StandoffSuperscriptTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents superscript in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffSubscriptTag - -:StandoffSubscriptTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents subscript in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff-html-editor#StandoffLineTag - -:StandoffLineTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents a line to seperate content in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff-html-editor#StandoffPreTag - -:StandoffPreTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents a preformatted content in a TextValue"@en . diff --git a/upgrade/plugins/pr1372/test_1372.py b/upgrade/plugins/pr1372/test_1372.py deleted file mode 100644 index 5b5a1fce64..0000000000 --- a/upgrade/plugins/pr1372/test_1372.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright @ 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - - -import tempfile -import rdflib -from rdflib.term import URIRef -from plugins.pr1372.update import GraphTransformer - - -save_output = False - - -def test_update(): - input_graph = rdflib.Graph() - input_graph.parse("plugins/pr1372/test_data.ttl", format="turtle") - transformer = GraphTransformer() - output_graph = transformer.transform(input_graph) - - query_result = output_graph.query( - """ - PREFIX knora-base: - - SELECT ?value WHERE { - ?value knora-base:valueCreationDate ?creationDate ; - knora-base:hasPermissions ?permissions . - } - """ - ) - - values_with_permissions = set([row["value"] for row in query_result]) - - assert values_with_permissions == { - URIRef('http://rdfh.ch/0001/thing-with-history/values/1c'), - URIRef('http://rdfh.ch/0001/thing-with-history/values/2c'), - URIRef('http://rdfh.ch/0001/thing-with-history/values/3b') - } - - if save_output: - temp_dir = tempfile.mkdtemp() - output_file_path = temp_dir + "/output.ttl" - output_graph.serialize(destination=output_file_path, format="turtle") - print("Wrote output to", output_file_path) diff --git a/upgrade/plugins/pr1372/test_data.ttl b/upgrade/plugins/pr1372/test_data.ttl deleted file mode 100644 index b03133b098..0000000000 --- a/upgrade/plugins/pr1372/test_data.ttl +++ /dev/null @@ -1,103 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . -@prefix owl: . -@prefix knora-base: . -@prefix knora-admin: . -@prefix anything: . - - a anything:Thing; - knora-base:isDeleted false; - knora-base:attachedToUser ; - knora-base:attachedToProject ; - rdfs:label "A thing with version history"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:creationDate "2019-02-08T15:05:10Z"^^xsd:dateTime; - knora-base:lastModificationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; - anything:hasInteger ; - anything:hasText ; - anything:hasOtherThing ; - anything:hasOtherThingValue . - - a knora-base:IntValue; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-11T09:05:10Z"^^xsd:dateTime; - knora-base:valueHasInteger 1; - knora-base:valueHasOrder 0; - knora-base:valueHasString "1"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser . - - a knora-base:IntValue; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-12T09:05:10Z"^^xsd:dateTime; - knora-base:valueHasInteger 2; - knora-base:valueHasOrder 0; - knora-base:valueHasString "2"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser ; - knora-base:previousValue . - - a knora-base:IntValue; - knora-base:valueHasUUID "pLlW4ODASumZfZFbJdpw1g"^^xsd:string; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; - knora-base:valueHasInteger 3; - knora-base:valueHasOrder 0; - knora-base:valueHasString "3"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser ; - knora-base:previousValue . - - a knora-base:TextValue; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-10T10:05:10Z"^^xsd:dateTime; - knora-base:valueHasOrder 0; - knora-base:valueHasString "one"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser . - - a knora-base:TextValue; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-11T10:05:10Z"^^xsd:dateTime; - knora-base:valueHasOrder 0; - knora-base:valueHasString "two"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser ; - knora-base:previousValue . - - a knora-base:TextValue; - knora-base:valueHasUUID "W5fm67e0QDWxRZumcXcs6g"^^xsd:string; - knora-base:isDeleted false; - knora-base:valueCreationDate "2019-02-12T10:05:10Z"^^xsd:dateTime; - knora-base:valueHasOrder 0; - knora-base:valueHasString "three"; - knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; - knora-base:attachedToUser ; - knora-base:previousValue . - - a knora-base:LinkValue; - rdf:subject ; - rdf:predicate anything:hasOtherThing; - rdf:object ; - knora-base:isDeleted false; - knora-base:attachedToUser ; - knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember"; - knora-base:valueCreationDate "2019-02-10T10:30:10Z"^^xsd:dateTime; - knora-base:valueHasString "http://rdfh.ch/0001/2qMtTWvVRXWMBcRNlduvCQ"; - knora-base:valueHasRefCount 1 . - - a knora-base:LinkValue; - knora-base:valueHasUUID "IZGOjVqxTfSNO4ieKyp0SA"^^xsd:string; - rdf:subject ; - rdf:predicate anything:hasOtherThing; - rdf:object ; - knora-base:isDeleted true; - knora-base:deleteDate "2019-02-13T09:00:10Z"^^xsd:dateTime; - knora-base:deletedBy ; - knora-base:attachedToUser ; - knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember"; - knora-base:valueCreationDate "2019-02-13T09:00:10Z"^^xsd:dateTime; - knora-base:valueHasString "http://rdfh.ch/0001/2qMtTWvVRXWMBcRNlduvCQ"; - knora-base:valueHasRefCount 0; - knora-base:previousValue . diff --git a/upgrade/plugins/pr1372/update.py b/upgrade/plugins/pr1372/update.py deleted file mode 100644 index 65a751a50e..0000000000 --- a/upgrade/plugins/pr1372/update.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright @ 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - - -import rdflib -from updatelib import rdftools - - -# The IRI of knora-base:valueCreationDate. -value_creation_date = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#valueCreationDate") - -# The IRI of knora-base:previousValue. -previous_value = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#previousValue") - -# The IRI of knora-base:hasPermissions. -has_permissions = rdflib.term.URIRef("http://www.knora.org/ontology/knora-base#hasPermissions") - - -# Updates values for PR 1372. -class GraphTransformer(rdftools.GraphTransformer): - def transform(self, graph): - # Group the statements in the named graph by subject and by predicate. - grouped_statements = rdftools.group_statements(graph) - - # Collect the IRIs of values to be transformed. - value_iris = collect_value_iris(graph, grouped_statements) - - # Remove knora-base:hasPermissions from those values. - for value_iri in value_iris: - for o in graph.objects(value_iri, has_permissions): - graph.remove((value_iri, has_permissions, o)) - - return graph - - -# Given a graph, collects the IRIs of all values that are past value versions. -def collect_value_iris(graph, grouped_statements): - value_iris = set() - - for subj, pred_objs in grouped_statements.items(): - if value_creation_date in pred_objs: - # This is a value. Is it a past value version? - if not rdftools.generator_is_empty(graph.subjects(previous_value, subj)): - # Yes. Include its IRI. - value_iris.add(subj) - - return value_iris diff --git a/upgrade/plugins/pr1440/knora-ontologies/knora-admin.ttl b/upgrade/plugins/pr1440/knora-ontologies/knora-admin.ttl deleted file mode 100644 index 3bf3c8988d..0000000000 --- a/upgrade/plugins/pr1440/knora-ontologies/knora-admin.ttl +++ /dev/null @@ -1,781 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix knora-base: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xml: . -@prefix xsd: . -@prefix foaf: . -@prefix dcterms: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The Knora admin ontology"@en ; - - knora-base:attachedToProject :SystemProject . - - -################################################################# -# -# Object Properties -# -################################################################# - - - -### http://www.knora.org/ontology/knora-admin#belongsToInstitution - -:belongsToInstitution rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates which Institution a project belongs to."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectClassConstraint :Institution . - - - -### http://www.knora.org/ontology/knora-admin#belongsToProject - -:belongsToProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates which project a group belongs to."@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#currentproject - -:currentproject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "This property indicates, which is the \"current project\" of a given user. A user can be part of any number of projects, but only one can be the active project."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#isInGroup - -:isInGroup rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given user is part of the given group."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :UserGroup . - - - -### http://www.knora.org/ontology/knora-admin#isInProject - -:isInProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given user is part of the given project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -### http://www.knora.org/ontology/knora-admin#isAdminForProject - -:isInProjectAdminGroup rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The given user is part of the given project's ProjectAdmin group."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectClassConstraint :knoraProject . - - - -################################################################# -# -# Datatype properties -# -################################################################# - - -### http://www.knora.org/ontology/knora-admin#address - -:address rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - knora-base:objectDatatypeConstraint xsd:string ; - - rdfs:comment "The address of a person or an institution"@en . - - -### http://www.knora.org/ontology/knora-admin#groupName - -:groupName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The group's name."@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectDatatypeConstraint xsd:string ; - - rdfs:subPropertyOf . - - - -### http://www.knora.org/ontology/knora-admin#groupDescription - -:groupDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of a user group"@en ; - - knora-base:subjectClassConstraint :UserGroup ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#hasSelfJoinEnabled - -:hasSelfJoinEnabled rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if users can add themselves to the project or group."@en ; - - # No knora-base:subjectClassConstraint, because this can be used with :knoraProject or :UserGroup. - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-admin#institutionName - -:institutionName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The institutions's name."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#institutionDescription - -:institutionDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of an institution."@en ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#institutionWebsite - -:institutionWebsite rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The URL of a web site."@en ; - - knora-base:subjectClassConstraint :Institution ; - - knora-base:objectDatatypeConstraint xsd:anyURI . - - - -### http://www.knora.org/ontology/knora-admin#isActiveUser - -:isInSystemAdminGroup rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if the user is a member of the SystemAdmin group."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-admin#givenName - -:givenName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf foaf:givenName, :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The user's given name."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#familyName - -:familyName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf foaf:familyName, :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The user's family name."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#password - -:password rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "An encrypted credential for access"@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#phone - -:phone rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The phone number of a person, institution, etc."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#preferredLanguage - -:preferredLanguage rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The ISO 639-1 code of the user's preferred language."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectDescription - -:projectDescription rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A description of a Knora project."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectKeyword - -:projectKeyword rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "A keyword describing a project."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectLongname - -:projectLongname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The longname of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectLogo - -:projectLogo rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The path to the projects's logo."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectRestrictedViewSize - -:projectRestrictedViewSize rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The size of the image (as defined by IIIF) returned for restricted view."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectRestrictedViewWatermark - -:projectRestrictedViewWatermark rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The path to the restricted view watermark."@en ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-admin#projectShortname - -:projectShortname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The unique shortname of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#projectShortcode - -:projectShortcode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The unique short code of a Knora project."@en ; - - rdfs:subPropertyOf ; - - knora-base:subjectClassConstraint :knoraProject ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#username - -:username rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The username and login name of a user."@en ; - - knora-base:subjectClassConstraint :User ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#email - -:email rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The email address and login name of a user."@en ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-admin#status - -:status rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "The status of the user / group / project. It is false if the entity has been deactivated (deleted)."@en ; - - knora-base:objectDatatypeConstraint xsd:boolean . - - - -################################################################# -# -# Classes -# -################################################################# - - - -### http://www.knora.org/ontology/knora-admin#Institution - -:Institution rdf:type owl:Class ; - - rdfs:subClassOf foaf:Organization , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionDescription ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :institutionWebsite ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :phone ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :address ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :email ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "An institution that has data in Knora."@en . - - - -### http://www.knora.org/ontology/knora-admin#User - -:User rdf:type owl:Class ; - - rdfs:subClassOf foaf:Person , - [ rdf:type owl:Restriction ; - owl:onProperty :username ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :email ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :familyName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :givenName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :password ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :preferredLanguage ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInProject ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInGroup ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isInSystemAdminGroup ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a Knora user."@en . - - - -### http://www.knora.org/ontology/knora-admin#UserGroup - -:UserGroup rdf:type owl:Class ; - - rdfs:subClassOf foaf:Group , - [ rdf:type owl:Restriction ; - owl:onProperty :groupName ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :groupDescription ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :belongsToProject ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasSelfJoinEnabled ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "A group of Knora users."@en . - - - - -### http://www.knora.org/ontology/knora-admin#knoraProject - -:knoraProject rdf:type owl:Class ; - - rdfs:subClassOf foaf:Project , - [ rdf:type owl:Restriction ; - owl:onProperty :projectShortname ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectShortcode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectLongname ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectDescription ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectKeyword ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectLogo ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectRestrictedViewSize ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :projectRestrictedViewWatermark ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :belongsToInstitution ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :status ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasSelfJoinEnabled ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a project that uses Knora."@en . - - - - -################################################################# -# -# Individuals -# -################################################################# - -### http://www.knora.org/ontology/knora-admin#UnknownUser -:UnknownUser rdf:type :UserGroup ; - :groupName "UnknownUser" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#KnownUser -:KnownUser rdf:type :UserGroup ; - :groupName "KnownUser" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#Creator -:Creator rdf:type :UserGroup ; - :groupName "Creator" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#ProjectMember -:ProjectMember rdf:type :UserGroup ; - :groupName "ProjectMember" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#ProjectAdmin -:ProjectAdmin rdf:type :UserGroup ; - :groupName "ProjectAdmin" ; - :status "true"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemAdmin -:SystemAdmin rdf:type :UserGroup ; - :groupName "SystemAdmin" ; - :belongsToProject :SystemProject ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemUser -:SystemUser rdf:type :User ; - rdfs:comment "A built-in system user."@en ; - :username "system"; - :email "system@localhost" ; - :givenName "Knora" ; - :familyName "System" ; - :password "-" ; - :status "true"^^xsd:boolean ; - :preferredLanguage "en" ; - :isInSystemAdminGroup "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#AnonymousUser -:AnonymousUser rdf:type :User ; - rdfs:comment "A built-in anonymous user."@en ; - :username "anonymous" ; - :email "anonymous@localhost" ; - :givenName "Knora" ; - :familyName "Anonymous" ; - :password "-" ; - :status "true"^^xsd:boolean ; - :preferredLanguage "en" ; - :isInSystemAdminGroup "false"^^xsd:boolean . - -### http://www.knora.org/ontology/knora-admin#SystemProject -:SystemProject rdf:type :knoraProject ; - rdfs:comment "A built-in project representing the Knora System."@en ; - :projectShortname "SystemProject" ; - :projectShortcode "FFFF" ; - :projectLongname "Knora System Project" ; - :projectDescription "Knora System Project"@en ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - - -### http://www.knora.org/ontology/knora-admin#SharedOntologiesProject -:DefaultSharedOntologiesProject rdf:type :knoraProject ; - rdfs:comment "The default project for shared ontologies."@en ; - :projectShortname "DefaultSharedOntologiesProject" ; - :projectShortcode "0000" ; - :projectLongname "Knora Default Shared Ontologies Project" ; - :projectDescription "Knora Shared Ontologies Project"@en ; - :status "true"^^xsd:boolean ; - :hasSelfJoinEnabled "false"^^xsd:boolean . - -# -## -### Permission Class Properties -## -# -### http://www.knora.org/ontology/knora-admin#forProject - -:forProject rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a knoraProject."@en ; - knora-base:subjectClassConstraint :Permission ; - knora-base:objectClassConstraint :knoraProject . - -### http://www.knora.org/ontology/knora-admin#forGroup -:forGroup rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a UserGroup."@en ; - knora-base:subjectClassConstraint :Permission ; - knora-base:objectClassConstraint :UserGroup . - -### http://www.knora.org/ontology/knora-admin#forResourceClass -:forResourceClass rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a resource class."@en ; - knora-base:subjectClassConstraint :Permission . - -### http://www.knora.org/ontology/knora-admin#forProperty -:forProperty rdf:type rdf:Property ; - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - rdfs:comment "Permission property pointing to a resource property."@en ; - knora-base:subjectClassConstraint :Permission . - - -# -## -### Permission Class and Sub-Classes -## -# -### http://www.knora.org/ontology/knora-admin#Permission -:Permission rdf:type owl:Class ; - rdfs:comment "Base Permission class."@en. - - -### http://www.knora.org/ontology/knora-admin#AdministrativePermission -:AdministrativePermission rdf:type owl:Class ; - rdfs:comment "Administrative Permission class used to create instances for storing administrative permissions on groups."@en ; - rdfs:subClassOf :Permission . - -### http://www.knora.org/ontology/knora-admin#DefaultObjectAccessPermission -:DefaultObjectAccessPermission rdf:type owl:Class ; - rdfs:comment "Default Object Access Permission class used to create instances for storing default object access permission for a project and either groups, resource classes, or properties."@en ; - rdfs:subClassOf :Permission . diff --git a/upgrade/plugins/pr1440/knora-ontologies/knora-base.ttl b/upgrade/plugins/pr1440/knora-ontologies/knora-base.ttl deleted file mode 100644 index 0b56cc12a6..0000000000 --- a/upgrade/plugins/pr1440/knora-ontologies/knora-base.ttl +++ /dev/null @@ -1,2721 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xml: . -@prefix xsd: . -@prefix foaf: . -@prefix dcterms: . -@prefix salsah-gui: . -@prefix knora-admin: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The Knora base ontology"@en ; - - :attachedToProject knora-admin:SystemProject ; - - :ontologyVersion "PR 1440" . - - - -################################################################# -# -# Properties -# -################################################################# - - - -### http://www.knora.org/ontology/knora-base#ontologyVersion - -:ontologyVersion rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates the version of the Knora built-in ontologies in a repository."@en ; - - :subjectClassConstraint owl:Ontology ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#isMainResource - -# This property is generated by a SPARQL CONSTRUCT query, it is not used in the triplestore and not used in the API - -:isMainResource rdf:type owl:DatatypeProperty ; - - rdfs:comment "Indicates if the given resource is the main resource of a request or a resource referred to by a link property."@en; - - :subjectClassConstraint :Resource ; - - :objectDatatypeConstraint xsd:boolean . - - -### http://www.knora.org/ontology/knora-base#objectCannotBeMarkedAsDeleted - -:objectCannotBeMarkedAsDeleted rdf:type rdf:Property ; - - rdfs:comment "The base property of properties whose objects can't be marked as deleted"@en . - - - -### http://www.knora.org/ontology/knora-base#objectDatatypeConstraint - -:objectDatatypeConstraint rdf:type owl:DatatypeProperty ; - - rdfs:comment "Specifies the type required as the object of a datatype property"@en . - - - -### http://www.knora.org/ontology/knora-base#resourceIcon - -:resourceIcon rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint owl:Class ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#resourceProperty - -:resourceProperty rdf:type owl:ObjectProperty ; - - rdfs:comment "The base property of properties that point from Knora resources to Knora resources or values. These properties are required to have cardinalities in the resource classes in which they are used."@en ; - - :subjectClassConstraint :Resource . - - - -### http://www.knora.org/ontology/knora-base#subjectClassConstraint - -:subjectClassConstraint rdf:type owl:ObjectProperty ; - - rdfs:comment "Specifies the OWL class that the subject of a property must belong to"@en . - - - -### http://www.knora.org/ontology/knora-base#objectClassConstraint - -:objectClassConstraint rdf:type owl:ObjectProperty ; - - rdfs:comment "Specifies the OWL class that the object of a property must belong to"@en . - - - -### http://www.knora.org/ontology/knora-base#isEditable - -:isEditable rdf:type owl:AnnotationProperty ; - - :objectDatatypeConstraint xsd:boolean ; - - rdfs:label "is editable"@en ; - - rdfs:comment "Indicates whether a property's values can be updated via the Knora API."@en . - - - -### http://www.knora.org/ontology/knora-base#canBeInstantiated - -:canBeInstantiated rdf:type owl:AnnotationProperty ; - - :subjectClassConstraint owl:Class ; - - :objectDatatypeConstraint xsd:boolean ; - - rdfs:label "can be instantiated"@en ; - - rdfs:comment "Indicates whether a resource class can be instantiated via the Knora API."@en . - - - -### http://www.knora.org/ontology/knora-base#attachedToProject - -:attachedToProject rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "attached to project"@en ; - - rdfs:comment "Connects something to a project"@en ; - - :objectClassConstraint knora-admin:knoraProject . - - - -### http://www.knora.org/ontology/knora-base#attachedToUser - -:attachedToUser rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "attached to user"@en ; - - rdfs:comment "Connects something to a user"@en ; - - :objectClassConstraint knora-admin:User . - - -### http://www.knora.org/ontology/knora-base#hasColor - -:hasColor rdf:type owl:ObjectProperty ; - - rdfs:label "Farbe"@de , - "Color"@en , - "Couleur"@fr , - "Colore"@it ; - - rdfs:comment """Specifies the color of a region."""@en ; - - salsah-gui:guiAttribute "ncolors=8"^^xsd:string ; - - :objectClassConstraint :ColorValue ; - - :subjectClassConstraint :Region ; - - rdfs:subPropertyOf :hasValue ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Colorpicker . - - - -### http://www.knora.org/ontology/knora-base#hasComment - -:hasComment rdf:type owl:ObjectProperty ; - - rdfs:label "Kommentar"@de , - "Comment"@en , - "Commentaire"@fr , - "Commento"@it ; - - rdfs:comment """Represents a comment on a resource as a knora-base:TextValue"""@de ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :TextValue ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Richtext ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasExtResValue - -:hasExtResValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat externen Wert"@de , - "has external Value"@en , - "a valeur externe"@fr , - "ha valore esterno"@it ; - - :objectClassConstraint :ExternalResValue ; - - :subjectClassConstraint :ExternalResource ; - - rdfs:subPropertyOf :hasValue . - - -### http://www.knora.org/ontology/knora-base#hasFileValue - -:hasFileValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :FileValue ; - - rdfs:label "hat Datei"@de , - "has file"@en , - "a fichier"@fr , - "ha file"@it ; - - rdfs:comment "Connects a Representation to a file"@en ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - :subjectClassConstraint :Representation ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasStillImageFileValue - -:hasStillImageFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Bilddatei"@de , - "has image file"@en , - "a fichier d'image"@fr , - "ha file imagine"@it ; - - rdfs:comment "Connects a Representation to an image file"@en ; - - :objectClassConstraint :StillImageFileValue ; - - :subjectClassConstraint :StillImageRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasMovingImageFileValue - -:hasMovingImageFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Filmdatei"@de , - "has movie file"@en , - "a fichier de film"@fr , - "ha file film"@it ; - - rdfs:comment "Connects a Representation to a movie file"@en ; - - :objectClassConstraint :MovingImageFileValue ; - - :subjectClassConstraint :MovingImageRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasAudioFileValue - -:hasAudioFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Audiodatei"@de , - "has audio file"@en , - "a fichier d'audio"@fr , - "ha file audio"@it ; - - rdfs:comment "Connects a Representation to an audio file"@en ; - - :objectClassConstraint :AudioFileValue ; - - :subjectClassConstraint :AudioRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasDDDFileValue - -:hasDDDFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat 3D-Datei"@de , - "has 3D-file"@en , - "a ficher de 3D"@fr , - "ha file 3D"@it ; - - rdfs:comment "Connects a Representation to a 3D-file"@en ; - - :objectClassConstraint :DDDFileValue ; - - :subjectClassConstraint :DDDRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasTextFileValue - -:hasTextFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Textdatei"@de , - "has text file"@en , - "a fichier de texte"@fr , - "ha file testo"@it ; - - rdfs:comment "Connects a Representation to a text file"@en ; - - :objectClassConstraint :TextFileValue ; - - :subjectClassConstraint :TextRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasDocumentFileValue - -:hasDocumentFileValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Dokument"@de , - "has document"@en , - "a document"@fr , - "ha documento"@it ; - - rdfs:comment "Connects a Representation to a document"@en ; - - :objectClassConstraint :DocumentFileValue ; - - :subjectClassConstraint :DocumentRepresentation ; - - :isEditable true ; - - salsah-gui:guiElement salsah-gui:Fileupload ; - - rdfs:subPropertyOf :hasFileValue . - - - -### http://www.knora.org/ontology/knora-base#hasGeometry - -:hasGeometry rdf:type owl:ObjectProperty ; - - rdfs:label "Geometrie"@de , - "Geometry"@en , - "Géometrie"@fr , - "Geometria"@it ; - - rdfs:comment """Represents a geometrical shape."""@en ; - - rdfs:subPropertyOf :hasValue ; - - salsah-gui:guiElement salsah-gui:Geometry ; - - :isEditable true ; - - :objectClassConstraint :GeomValue ; - - :subjectClassConstraint :Region . - - - -### http://www.knora.org/ontology/knora-base#hasLinkTo - -:hasLinkTo rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :resourceProperty ; - - rdfs:label "hat Link zu"@de , - "has Link to"@en , - "a lien vers"@fr , - "ha Link verso"@it ; - - rdfs:comment "Represents a direct connection between two resources"@en ; - - :isEditable true ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :Resource . - - - -### http://www.knora.org/ontology/knora-base#hasLinkToValue - -:hasLinkToValue rdf:type owl:ObjectProperty ; - - rdfs:comment "Points to a LinkValue reification describing a link between two resources"@en ; - - rdfs:label "hat Link zu"@de , - "has Link to"@en , - "a lien vers"@fr , - "ha Link verso"@it ; - - rdfs:comment "Represents a direct connection between two resources"@en ; - - :isEditable true ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasValue . - - - -### http://www.knora.org/ontology/knora-base#hasRepresentation - -:hasRepresentation rdf:type owl:ObjectProperty ; - - rdfs:label "hat Repräsentation"@de , - "has Representation"@en , - "a Répresentation"@fr , - "ha Rappresentazione"@it ; - - rdfs:comment "References an instance of a Representation. A Representation contains the metadata of a digital object (= file) which represents some physical entity such as an image, a sound, an encoded text etc."@en ; - - :objectClassConstraint :Representation ; - - :subjectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#hasRepresentationValue - -:hasRepresentationValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - - -### http://www.knora.org/ontology/knora-base#hasStandoffLinkTo - -:hasStandoffLinkTo rdf:type owl:ObjectProperty ; - - rdfs:label "hat Standoff Link zu"@de , - "has Standoff Link to"@en , - "a standoff lien vers"@fr , - "ha standoff link verso"@it ; - - rdfs:comment "Repräsentiert einen Link im Standoff Markup von einer Ressource zu einer anderen"@de , - "Represents a link in standoff markup from one resource to another."@en ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#hasStandoffLinkToValue - -:hasStandoffLinkToValue rdf:type owl:ObjectProperty ; - - rdfs:label "hat Standoff Link zu"@de , - "has Standoff Link to"@en , - "a standoff lien vers"@fr , - "ha standoff link verso"@it ; - - rdfs:comment "Repräsentiert einen Link im Standoff Markup von einer Ressource zu einer anderen"@de , - "Represents a link in standoff markup from one resource to another."@en ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#standoffTagHasLink - -:standoffTagHasLink rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :Resource ; - - :subjectClassConstraint :StandoffLinkTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasInternalReference - -:standoffTagHasInternalReference rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :StandoffTag ; - - :subjectClassConstraint :StandoffInternalReferenceTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStart - -:standoffTagHasStart rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEnd - -:standoffTagHasEnd rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartIndex - -:standoffTagHasStartIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEndIndex - -:standoffTagHasEndIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartAncestor - -:standoffTagHasStartAncestor rdf:type owl:ObjectProperty, owl:TransitiveProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasStartParent - -:standoffTagHasStartParent rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted, :standoffTagHasStartAncestor ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasEndParent - -:standoffTagHasEndParent rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasUUID - -:standoffTagHasUUID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :StandoffTag ; - - :objectDatatypeConstraint xsd:string . - - -:valueHasMaxStandoffStartIndex rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#hasSubListNode - -:hasSubListNode rdf:type owl:ObjectProperty ; - - rdfs:comment "A hierarchical list is formed using the \"hasSubListNode\"-property"@en ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectClassConstraint :ListNode ; - - :subjectClassConstraint :ListNode . - - -### http://www.knora.org/ontology/knora-base#hasValue - -:hasValue rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :resourceProperty ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :Value . - - -### http://www.knora.org/ontology/knora-base#isAnnotationOf - -:isAnnotationOf rdf:type owl:ObjectProperty ; - - rdfs:label "ist Annotation von"@de , - "is Annotation of"@en , - "est Annotation de"@fr , - "è Annotation di"@it ; - - :subjectClassConstraint :Annotation ; - - :objectClassConstraint :Resource ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isAnnotationOfValue - -:isAnnotationOfValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Annotation ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#isPartOf - -:isPartOf rdf:type owl:ObjectProperty ; - - rdfs:label "ist Teil von"@de , - "is part of"@en , - "fait partie de"@fr , - "fa parte di"@it ; - - rdfs:comment "Indicates that this resource is part of another resource"@en ; - - :subjectClassConstraint :Resource ; - - :objectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isPartOfValue - -:isPartOfValue rdf:type owl:ObjectProperty ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Resource ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#isRegionOf - -:isRegionOf rdf:type owl:ObjectProperty ; - - rdfs:comment "Region of interest within a digital object (e.g. an image)"@en ; - - rdfs:label "is Region von"@de , - "is region of"@en , - "est région de"@fr , - "è regione di"@it ; - - :subjectClassConstraint :Region ; - - :objectClassConstraint :Representation ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkTo . - - - -### http://www.knora.org/ontology/knora-base#isRegionOfValue - -:isRegionOfValue rdf:type owl:ObjectProperty ; - - rdfs:comment "Region of interest within a digital object (e.g. an image)"@en ; - - rdfs:label "is Region von"@de , - "is region of"@en , - "est région de"@fr , - "è regione di"@it ; - - :objectClassConstraint :LinkValue ; - - :subjectClassConstraint :Region ; - - :isEditable true ; - - rdfs:subPropertyOf :hasLinkToValue . - - - -### http://www.knora.org/ontology/knora-base#previousValue - -:previousValue rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "Points to the previous verson of a value"@en ; - - :subjectClassConstraint :Value ; - - :objectClassConstraint :Value . - - - -### http://www.knora.org/ontology/knora-base#seqnum - -:seqnum rdf:type owl:ObjectProperty ; - - :objectClassConstraint :IntValue ; - - rdfs:subPropertyOf :hasValue ; - - rdfs:label "Sequenznummer"@de , - "Sequence number"@en , - "Numéro de séquence"@fr , - "Numero di sequenza"@it ; - - rdfs:comment "Indicates the position of a resource within a sequence"@en . - - -### http://www.knora.org/ontology/knora-base#standoffTagHasOriginalXMLID - -:standoffTagHasOriginalXMLID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:string ; - - :subjectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#targetHasOriginalXMLID - -# This property is generated by a SPARQL CONSTRUCT query, it is not used in the triplestore and not used in the API - -:targetHasOriginalXMLID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:string ; - - :subjectClassConstraint :StandoffTag . - - -### http://www.knora.org/ontology/knora-base#valueHasStandoff - -:valueHasStandoff rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :objectClassConstraint :StandoffTag ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#valueHasLanguage - -:valueHasLanguage rdf:type owl:DatatypeProperty ; - - :objectDatatypeConstraint xsd:string ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#valueHasMapping - -:valueHasMapping rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :objectClassConstraint :XMLToStandoffMapping ; - - :subjectClassConstraint :TextValue . - - -### http://www.knora.org/ontology/knora-base#hasMappingElement - -:hasMappingElement rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "mapping element"@en ; - - rdfs:comment """Represents an element in a mapping"""@en ; - - :subjectClassConstraint :XMLToStandoffMapping ; - - :objectClassConstraint :MappingElement . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLTagname - -:mappingHasXMLTagname rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML tag"@en ; - - rdfs:comment """name of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLNamespace - -:mappingHasXMLNamespace rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "namespace of the XML tag"@en ; - - rdfs:comment """namespace of the XML tag"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLClass - -:mappingHasXMLClass rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "class of the XML tag"@en ; - - rdfs:comment """class of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffClass - -:mappingHasStandoffClass rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "IRI of the standoff class"@en ; - - rdfs:comment """IRI of the standoff class"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectClassConstraint owl:Class . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLAttribute - -:mappingHasXMLAttribute rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML attribute"@en ; - - rdfs:comment """name of the XML attribute"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectClassConstraint :MappingXMLAttribute . - - -### http://www.knora.org/ontology/knora-base#mappingHasXMLAttributename - -:mappingHasXMLAttributename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "name of the XML attribute"@en ; - - rdfs:comment """name of the XML attribute"""@en ; - - :subjectClassConstraint :MappingComponent ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffProperty - -:mappingHasStandoffProperty rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "IRI of the standoff property"@en ; - - rdfs:comment """IRI of the standoff property"""@en ; - - :subjectClassConstraint :MappingXMLAttribute . - - -### http://www.knora.org/ontology/knora-base#mappingHasStandoffDataTypeClass - -:mappingHasStandoffDataTypeClass rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "datatype of the XML tag"@en ; - - rdfs:comment """datatype of the XML tag"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectClassConstraint :MappingStandoffDataTypeClass . - - -### http://www.knora.org/ontology/knora-base#mappingElementRequiresSeparator - -:mappingElementRequiresSeparator rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "indicates if the element requires a separator in the text"@en ; - - rdfs:comment """indicates if the element requires a separator in the text"""@en ; - - :subjectClassConstraint :MappingElement ; - - :objectDatatypeConstraint xsd:boolean . - - -### http://www.knora.org/ontology/knora-base#mappingHasDefaultXSLTransformation - -:mappingHasDefaultXSLTransformation rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:label "default XSL Transformation"@en ; - - rdfs:comment """default XSL Transformation for this mapping"""@en ; - - :subjectClassConstraint :XMLToStandoffMapping ; - - :objectClassConstraint :XSLTransformation . - - -### http://www.knora.org/ontology/knora-base#deletedBy - -:deletedBy rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates who deleted a resource or value"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectClassConstraint knora-admin:User . - - -################################################################# -# -# Datatype properties -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#creationDate - -:creationDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates when a resource was created"@en ; - - :subjectClassConstraint :Resource ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#deleteDate - -:deleteDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Indicates when a resource or value was deleted"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:dateTime . - - -### http://www.knora.org/ontology/knora-base#dimX - -:dimX rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :FileValue ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#dimY - -:dimY rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :FileValue ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#duration - -:duration rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#extResAccessInfo - -:extResAccessInfo rdf:type owl:DatatypeProperty ; - - rdfs:comment "Information (URL etc.) for accessing an external resource"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#extResId - -:extResId rdf:type owl:DatatypeProperty ; - - rdfs:comment "The ID of the external resource. The form of the ID is dependent on the provider."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#extResProvider - -:extResProvider rdf:type owl:DatatypeProperty ; - - rdfs:comment "The name of the external provider of the resource"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ExternalResValue ; - - :objectDatatypeConstraint xsd:string . - - - - -### http://www.knora.org/ontology/knora-base#fps - -:fps rdf:type owl:DatatypeProperty ; - - rdfs:label "Frames per second"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :MovingImageFileValue ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#internalFilename - -:internalFilename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#internalMimeType - -:internalMimeType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#isDeleted - -:isDeleted rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - rdfs:comment "Exists and is true if the resource has been deleted"@en ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#isRootNode - -:isRootNode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#hasRootNode - -:hasRootNode rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint :ListNode . - - - - -### http://www.knora.org/ontology/knora-base#lastModificationDate - -:lastModificationDate rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#listNodePosition - -:listNodePosition rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#listNodeName - -:listNodeName rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :subjectClassConstraint :ListNode ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#originalFilename - -:originalFilename rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#originalMimeType - -:originalMimeType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :FileValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasComment - -:valueHasComment rdf:type owl:DatatypeProperty ; - - rdfs:comment "A comment on a value"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#deleteComment - -:deleteComment rdf:type owl:DatatypeProperty ; - - rdfs:comment "A comment explaining why a resource or value was marked as deleted"@en ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - # No :subjectClassConstraint, because this can be used with :Resource or :Value. - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueCreationDate - -:valueCreationDate rdf:type owl:DatatypeProperty ; - - :subjectClassConstraint :Value ; - - rdfs:subPropertyOf :valueHas ; - - :objectDatatypeConstraint xsd:dateTime . - - - -### http://www.knora.org/ontology/knora-base#valueHas - -:valueHas rdf:type rdf:Property ; - - :subjectClassConstraint :ValueBase ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted . - - - -### http://www.knora.org/ontology/knora-base#valueHasUUID - -:valueHasUUID rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "The UUID of a value"@en ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasCalendar - -:valueHasCalendar rdf:type owl:DatatypeProperty ; - - rdfs:comment "Name of the calendar to be used, such as \"GREGORIAN\" or \"JULIAN\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasColor - -:valueHasColor rdf:type owl:DatatypeProperty ; - - rdfs:comment "Color in the form of #rrggbb (as defining web colors)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ColorBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasEndJDN - -:valueHasEndJDN rdf:type owl:DatatypeProperty ; - - rdfs:comment "Contains the end of a date as a Julian Day Number (JDN)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasEndPrecision - -:valueHasEndPrecision rdf:type owl:DatatypeProperty ; - - rdfs:comment "Precision of knowledge about the end of the date. Allowed are \"DAY\", \"MONTH\" or \"YEAR\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasDecimal - -:valueHasDecimal rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DecimalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasGeometry - -:valueHasGeometry rdf:type owl:DatatypeProperty ; - - rdfs:comment "JSON string describing a geometry (e.g. a region). Currently geometries are limited to 2D unions of primitive objects like circles, squares and polygons."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :GeomValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasGeonameCode - -:valueHasGeonameCode rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :GeonameValue ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasInteger - -:valueHasInteger rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasBoolean - -:valueHasBoolean rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :BooleanBase ; - - :objectDatatypeConstraint xsd:boolean . - - - -### http://www.knora.org/ontology/knora-base#valueHasUri - -:valueHasUri rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :UriBase ; - - :objectDatatypeConstraint xsd:anyURI . - - - -### http://www.knora.org/ontology/knora-base#valueHasIntervalEnd - -:valueHasIntervalEnd rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntervalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasIntervalStart - -:valueHasIntervalStart rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :IntervalBase ; - - :objectDatatypeConstraint xsd:decimal . - - - -### http://www.knora.org/ontology/knora-base#valueHasListNode - -:valueHasListNode rdf:type owl:ObjectProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :ListValue ; - - :objectClassConstraint :ListNode . - - - -### http://www.knora.org/ontology/knora-base#valueHasOrder - -:valueHasOrder rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:integer . - - -### http://www.knora.org/ontology/knora-base#valueHasRefCount - -:valueHasRefCount rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :LinkValue ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasStartJDN - -:valueHasStartJDN rdf:type owl:DatatypeProperty ; - - rdfs:comment "Contains the start of a date as a Julian Day Number (JDN)"@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:integer . - - - -### http://www.knora.org/ontology/knora-base#valueHasStartPrecision - -:valueHasStartPrecision rdf:type owl:DatatypeProperty ; - - rdfs:comment "The precision the start of a date. Allowed values are \"DAY\", \"MONTH\", or \"YEAR\"."@en ; - - rdfs:subPropertyOf :valueHas ; - - :subjectClassConstraint :DateBase ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#valueHasString - -:valueHasString rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :valueHas ; - - rdfs:comment "A string representation of a value, required for full-text searches and search results."@en ; - - :subjectClassConstraint :Value ; - - :objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/knora-base#hasPermissions - -:hasPermissions rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf :objectCannotBeMarkedAsDeleted ; - - :objectDatatypeConstraint xsd:string . - - - -################################################################# -# -# Classes -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#Annotation - -:Annotation rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isAnnotationOf ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isAnnotationOfValue ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Annotation"@de , - "Annotation"@en , - "Annotation"@fr , - "Annotation"@it ; - - :canBeInstantiated true ; - - rdfs:comment "A generic class for representing annotations"@en . - - - -### http://www.knora.org/ontology/knora-base#AudioFileValue - -:AudioFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :duration ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents an audio file"@en . - - - -### http://www.knora.org/ontology/knora-base#AudioRepresentation - -:AudioRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasAudioFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Audio)"@de , - "Representation (Audio)"@en , - "Répresentation (Audio)"@fr , - "Rappresentazione (Audio)"@it ; - - rdfs:comment "Represents a file containing audio data"@en . - - -### http://www.knora.org/ontology/knora-base#ColorBase - -:ColorBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasColor ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#ColorValue - -:ColorValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :ColorBase ; - - rdfs:comment "Represents a color in HTML format, e.g. \"#33eeff\""@en . - - - -### http://www.knora.org/ontology/knora-base#DDDFileValue - -:DDDFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue ; - - rdfs:comment "This represents some 3D-object with mesh data, point cloud, etc."@en . - - - -### http://www.knora.org/ontology/knora-base#DDDRepresentation - -:DDDRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasDDDFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (3D)"@de , - "Representation (3D)"@en , - "Répresentation (3D)"@fr , - "Rappresentazione (3D)"@it ; - - rdfs:comment "Represents a file containg 3D data"@en . - - -### http://www.knora.org/ontology/knora-base#DateBase - -:DateBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasCalendar ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasEndPrecision ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasEndJDN ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStartPrecision ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStartJDN ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#DateValue - -:DateValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :DateBase ; - - rdfs:comment "Represents a Knora date value"@en . - - - -### http://www.knora.org/ontology/knora-base#DocumentFileValue - -:DocumentFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue . - - - -### http://www.knora.org/ontology/knora-base#DocumentRepresentation - -:DocumentRepresentation rdf:type owl:Class ; - - rdfs:label "Repräsentation (Dokument)"@de , - "Representation (Document)"@en , - "Répresentation (Document)"@fr , - "Rappresentazione (Documento)"@it ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasDocumentFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ExternalResValue - -:ExternalResValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :extResId ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :extResProvider ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :extResAccessInfo ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ExternalResource - -:ExternalResource rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasExtResValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Externe Ressource"@de , - "External Resource"@en , - "Ressource Externe"@fr , - "Risorsa esterna"@it ; - - rdfs:comment "Represents a proxy for an object stored by an external provider"@en . - - - -### http://www.knora.org/ontology/knora-base#FileValue - -:FileValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :originalMimeType ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :internalFilename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :internalMimeType ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :originalFilename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#DecimalBase - -:DecimalBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasDecimal ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#DecimalValue - -:DecimalValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :DecimalBase ; - - rdfs:comment "Represents an arbitrary-precision decimal value"@en . - - - -### http://www.knora.org/ontology/knora-base#GeomValue - -:GeomValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasGeometry ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a geometrical objects as JSON string"@en . - - - -### http://www.knora.org/ontology/knora-base#GeonameValue - -:GeonameValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasGeonameCode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#IntBase - -:IntBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasInteger ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#IntValue - -:IntValue rdf:type owl:Class ; - - rdfs:subClassOf :Value, :IntBase ; - - rdfs:comment "Represents an integer value"@en . - -### http://www.knora.org/ontology/knora-base#BooleanBase - -:BooleanBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasBoolean ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#BooleanValue - -:BooleanValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :BooleanBase ; - - rdfs:comment "Represents a boolean value"@en . - - - -### http://www.knora.org/ontology/knora-base#UriBase - -:UriBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasUri ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - -### http://www.knora.org/ontology/knora-base#UriValue - -:UriValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :UriBase ; - - rdfs:comment "Represents a URI"@en . - -### http://www.knora.org/ontology/knora-base#IntervalBase - -:IntervalBase rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasIntervalEnd ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasIntervalStart ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - -### http://www.knora.org/ontology/knora-base#IntervalValue - -:IntervalValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - :IntervalBase ; - - rdfs:comment "Represents a time interval, e.g. in an audio recording"@en . - - - -### http://www.knora.org/ontology/knora-base#LinkObj - -:LinkObj rdf:type owl:Class ; - - rdfs:label "Verknüpfungsobjekt"@de , - "Link Object"@en , - "Objet de lien"@fr , - "Oggetto di connessione"@it ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasLinkTo ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasLinkToValue ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - :resourceIcon "link.gif"^^xsd:string ; - - :canBeInstantiated true ; - - rdfs:comment "Verknüpfung mehrerer Resourcen"@de , - "Represents a generic link object"@en . - - - -### http://www.knora.org/ontology/knora-base#LinkValue - -:LinkValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - rdf:Statement , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasRefCount ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:subject ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:predicate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdf:object ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "A reification node that describes direct links between resources"@en . - - - -### http://www.knora.org/ontology/knora-base#ListNode - -:ListNode rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :hasSubListNode ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :listNodePosition ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :listNodeName ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRootNode ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasRootNode ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToProject ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty rdfs:label ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:comment "Represents a flat or hierarchical list"@en . - - - -### http://www.knora.org/ontology/knora-base#ListValue - -:ListValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasListNode ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#MovingImageFileValue - -:MovingImageFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :dimX ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :dimY ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :fps ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :duration ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a moving image file"@en . - - - -### http://www.knora.org/ontology/knora-base#MovingImageRepresentation - -:MovingImageRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasMovingImageFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Video)"@de , - "Representation (Movie)"@en , - "Répresentation (Film)"@fr , - "Rappresentazione (Film)"@it ; - - rdfs:comment "A resource containing moving image data"@en . - - - -### http://www.knora.org/ontology/knora-base#Region - -:Region rdf:type owl:Class ; - - rdfs:label "Region"@de , - "Region"@en , - "Région"@fr , - "Regione"@it ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasColor ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRegionOf ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasGeometry ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isRegionOfValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] ; - - :resourceIcon "region.gif"^^xsd:string ; - - :canBeInstantiated true ; - - rdfs:comment "Represents a geometric region of a resource. The geometry is represented currently as JSON string."@en . - - - -### http://www.knora.org/ontology/knora-base#Representation - -:Representation rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation"@de , - "Representation"@en , - "Répresentation"@fr , - "Rappresentazione"@it ; - - rdfs:comment "A resource that can store a file"@en . - - - -### http://www.knora.org/ontology/knora-base#Resource - -:Resource rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty rdfs:label ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isDeleted ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStandoffLinkTo ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStandoffLinkToValue ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToUser ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToProject ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasPermissions ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :creationDate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :lastModificationDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deletedBy ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Ressource"@de , - "Resource"@en , - "Ressource"@fr , - "Risorsa"@it ; - - rdfs:comment "Represents something in the world, or an abstract thing"@en . - - -################################################################# -# -# Generic Standoff Tag -# -################################################################# - - -:standoffParentClassConstraint rdf:type owl:ObjectProperty . - - -### http://www.knora.org/ontology/knora-base#StandoffTag - -:StandoffTag rdf:type owl:Class ; - - rdfs:subClassOf [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStart ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEnd ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasUUID ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasOriginalXMLID ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStartIndex ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEndIndex ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasStartParent ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasEndParent ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffParentClassConstraint; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a standoff markup tag"@en . - - - -################################################################# -# -# Abstract Standoff Data Type Tag -# -################################################################# - -### http://www.knora.org/ontology/knora-base#StandoffDataTypeTag - -:StandoffDataTypeTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffTag ; - - rdfs:comment "Represents a knora-base value type in a TextValue"@en . - - -################################################################# -# -# Standoff Data Type Tags that can be instantiated -# -################################################################# - - -### http://www.knora.org/ontology/knora-base#StandoffLinkTag - -:StandoffLinkTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasLink ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a reference to a Knora resource in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffUriTag - -:StandoffUriTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag , - :UriBase ; - - rdfs:comment "Represents an arbitrary URI in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffDateTag - -:StandoffDateTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :DateBase ; - - rdfs:comment "Represents a date in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffColorTag - -:StandoffColorTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :ColorBase ; - - rdfs:comment "Represents a color in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffIntegerTag - -:StandoffIntegerTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :IntBase ; - - rdfs:comment "Represents an integer value in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffDecimalTag - -:StandoffDecimalTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :DecimalBase ; - - rdfs:comment "Represents a decimal (floating point) value in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffIntervalTag - -:StandoffIntervalTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :IntervalBase ; - - rdfs:comment "Represents an interval in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffBooleanTag - -:StandoffBooleanTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :BooleanBase ; - - rdfs:comment "Represents a boolean in a TextValue"@en . - - -### http://www.knora.org/ontology/knora-base#StandoffInternalReferenceTag - -:StandoffInternalReferenceTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffDataTypeTag, - :ValueBase, - [ rdf:type owl:Restriction ; - owl:onProperty :standoffTagHasInternalReference ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents an internal reference in a TextValue"@en . - - - -### http://www.knora.org/ontology/knora-base#StillImageFileValue - -:StillImageFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue , - [ rdf:type owl:Restriction ; - owl:onProperty :dimY ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :dimX ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "A file containing a two-dimensional still image"@en . - - - -### http://www.knora.org/ontology/knora-base#StillImageRepresentation - -:StillImageRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasStillImageFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Bild)"@de , - "Representation (Image)"@en , - "Répresentation (Image)"@fr , - "Rappresentazione (Imagine)"@it ; - - rdfs:comment "A resource that can contain a two-dimensional still image file"@en . - - - -### http://www.knora.org/ontology/knora-base#TextFileValue - -:TextFileValue rdf:type owl:Class ; - - rdfs:subClassOf :FileValue ; - - rdfs:comment "A text file such as plain Unicode text, LaTeX, TEI/XML, etc."@en . - - - -### http://www.knora.org/ontology/knora-base#TextRepresentation - -:TextRepresentation rdf:type owl:Class ; - - rdfs:subClassOf :Representation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasTextFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Repräsentation (Text)"@de , - "Representation (Text)"@en , - "Répresentation (Texte)"@fr , - "Rappresentazione (testo)"@it ; - - rdfs:comment "A resource containing a text file"@en . - - -### http://www.knora.org/ontology/knora-base#ForbiddenResource - -:ForbiddenResource rdf:type owl:Class ; - - rdfs:subClassOf :Resource , - [ rdf:type owl:Restriction ; - owl:onProperty :hasComment ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ]; - - rdfs:label """A ForbiddenResource is a proxy for a resource that the client has insufficient permissions to see."""@en ; - - rdfs:comment """A ForbiddenResource is a proxy for a resource that the client has insufficient permissions to see."""@en . - -### http://www.knora.org/ontology/knora-base#XSLTransformation - -:XSLTransformation rdf:type owl:Class ; - - rdfs:subClassOf :TextRepresentation , - [ rdf:type owl:Restriction ; - owl:onProperty :hasTextFileValue ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "a TextRepresentation representing an XSL transformation that can be applied to an XML created from standoff. The transformation's result is ecptected to be HTML."@en ; - - rdfs:comment "a TextRepresentation representing an XSL transformation that can be applied to an XML created from standoff. The transformation's result is ecptected to be HTML."@en . - - -### http://www.knora.org/ontology/knora-base#MappingComponent - -:MappingComponent rdf:type owl:Class ; - - rdfs:label "Component of a mapping"@en ; - - rdfs:comment "Component of a mapping" . - - -### http://www.knora.org/ontology/knora-base#MappingStandoffDataTypeClass - -:MappingStandoffDataTypeClass rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttributename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffClass ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML attributes to standoff properties"@en ; - - rdfs:comment "Mapping from XML attributes to standoff properties" . - - -### http://www.knora.org/ontology/knora-base#MappingXMLAttribute - -:MappingXMLAttribute rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttributename ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLNamespace ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffProperty ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML attributes to standoff properties"@en ; - - rdfs:comment "Mapping from XML attributes to standoff properties" . - - -### http://www.knora.org/ontology/knora-base#MappingElement - -:MappingElement rdf:type owl:Class ; - - rdfs:subClassOf :MappingComponent , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLTagname ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLNamespace ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLClass ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffClass ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasXMLAttribute ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasStandoffDataTypeClass ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :mappingElementRequiresSeparator ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ]; - - rdfs:label "Mapping from XML to standoff entities"@en ; - - rdfs:comment "Mapping from XML to standoff entities" . - -### http://www.knora.org/ontology/knora-base#XMLToStandoffMapping - -:XMLToStandoffMapping rdf:type owl:Class ; - - rdfs:subClassOf - [ rdf:type owl:Restriction ; - owl:onProperty :hasMappingElement ; - owl:minCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :mappingHasDefaultXSLTransformation ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:label "Mapping from XML to standoff entities"@en ; - - rdfs:comment "Mapping from XML to standoff entities" . - -### http://www.knora.org/ontology/knora-base#TextValue - -:TextValue rdf:type owl:Class ; - - rdfs:subClassOf :Value , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasStandoff ; - owl:minCardinality "0"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasMaxStandoffStartIndex ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasLanguage ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ], - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasMapping ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] . - - - -### http://www.knora.org/ontology/knora-base#ValueBase - -:ValueBase rdf:type owl:Class . - - -### http://www.knora.org/ontology/knora-base#Value - -:Value rdf:type owl:Class ; - - rdfs:subClassOf :ValueBase, - [ rdf:type owl:Restriction ; - owl:onProperty :valueCreationDate ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :attachedToUser ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :hasPermissions ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasOrder ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :isDeleted ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteDate ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deletedBy ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :deleteComment ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :previousValue ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasString ; - owl:cardinality "1"^^xsd:nonNegativeInteger - ] , - [ rdf:type owl:Restriction ; - owl:onProperty :valueHasUUID ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - - rdfs:comment "The base class of classes representing Knora values"@en . diff --git a/upgrade/plugins/pr1440/knora-ontologies/salsah-gui.ttl b/upgrade/plugins/pr1440/knora-ontologies/salsah-gui.ttl deleted file mode 100644 index 6c183c0f51..0000000000 --- a/upgrade/plugins/pr1440/knora-ontologies/salsah-gui.ttl +++ /dev/null @@ -1,237 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix : . -@prefix owl: . -@prefix rdf: . -@prefix xml: . -@prefix xsd: . -@prefix rdfs: . -@prefix knora-base: . -@prefix knora-admin: . -@base . - - rdf:type owl:Ontology ; - - rdfs:label "The salsah-gui ontology"@en ; - - knora-base:attachedToProject knora-admin:SystemProject . - - -################################################################# -# -# Properties -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#guiOrder - -:guiOrder rdf:type owl:DatatypeProperty ; - - knora-base:subjectClassConstraint owl:Restriction ; - - knora-base:objectDatatypeConstraint xsd:nonNegativeInteger . - - - -### http://www.knora.org/ontology/salsah-gui#guiElement - -:guiElement rdf:type owl:ObjectProperty . - - - -### http://www.knora.org/ontology/salsah-gui#guiAttribute - -:guiAttribute rdf:type owl:DatatypeProperty ; - - knora-base:objectDatatypeConstraint xsd:string . - - - -### http://www.knora.org/ontology/salsah-gui#guiAttributeDefinition - -:guiAttributeDefinition rdf:type owl:DatatypeProperty ; - - knora-base:subjectClassConstraint :Guielement ; - - knora-base:objectDatatypeConstraint xsd:string . - - - - - -################################################################# -# -# Classes -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#Guielement - -:Guielement rdf:type owl:Class . - - - - - -################################################################# -# -# Individuals -# -################################################################# - - -### http://www.knora.org/ontology/salsah-gui#Colorpicker - -:Colorpicker rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "ncolors:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#Date - -:Date rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Geometry - -:Geometry rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Geonames - -:Geonames rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Iconclass - -# :Iconclass rdf:type :Guielement , -# owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Interval - -:Interval rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#List - -:List rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Pulldown - -:Pulldown rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Radio - -:Radio rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "hlist(required):iri" . - - - -### http://www.knora.org/ontology/salsah-gui#Richtext - -:Richtext rdf:type :Guielement , - owl:NamedIndividual . - - - -### http://www.knora.org/ontology/salsah-gui#Searchbox - -:Searchbox rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "numprops:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#SimpleText - -:SimpleText rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "size:integer" , - "maxlength:integer" . - - - -### http://www.knora.org/ontology/salsah-gui#Slider - -:Slider rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "max(required):decimal" , - "min(required):decimal" . - - - -### http://www.knora.org/ontology/salsah-gui#Spinbox - -:Spinbox rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "max:decimal" , - "min:decimal" . - - - -### http://www.knora.org/ontology/salsah-gui#Textarea - -:Textarea rdf:type :Guielement , - owl:NamedIndividual ; - - :guiAttributeDefinition "cols:integer" , - "rows:integer" , - "width:percent" , - "wrap:string(soft|hard)" . - - -### http://www.knora.org/ontology/salsah-gui#Checkbox - -:Checkbox rdf:type :Guielement , - owl:NamedIndividual . - - -### http://www.knora.org/ontology/salsah-gui#Fileupload - -:Fileupload rdf:type :Guielement , - owl:NamedIndividual . diff --git a/upgrade/plugins/pr1440/knora-ontologies/standoff-data.ttl b/upgrade/plugins/pr1440/knora-ontologies/standoff-data.ttl deleted file mode 100644 index b449590294..0000000000 --- a/upgrade/plugins/pr1440/knora-ontologies/standoff-data.ttl +++ /dev/null @@ -1,631 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix xml: . -@prefix xsd: . -@prefix rdf: . -@prefix rdfs: . -@prefix owl: . -@prefix foaf: . -@prefix knora-base: . -@prefix salsah-gui: . -@prefix standoff: . - - a knora-base:XMLToStandoffMapping ; - rdfs:label "mapping for HTML"@en ; - knora-base:hasMappingElement - , - , - , - , - , - , - , - , - , - , - , - - #### additional elements - - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffRootTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingHasXMLTagname "text"^^xsd:string ; - knora-base:mappingElementRequiresSeparator false ; - knora-base:mappingHasXMLAttribute . - - - a knora-base:MappingXMLAttribute ; - knora-base:mappingHasStandoffProperty standoff:standoffRootTagHasDocumentType ; - knora-base:mappingHasXMLAttributename "documentType"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffParagraphTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "p"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffItalicTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator false ; - knora-base:mappingHasXMLTagname "em"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffBoldTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator false ; - knora-base:mappingHasXMLTagname "strong"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffUnderlineTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator false ; - knora-base:mappingHasXMLTagname "u"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffSubscriptTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator false ; - knora-base:mappingHasXMLTagname "sub"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffSuperscriptTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator false ; - knora-base:mappingHasXMLTagname "sup"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffStrikethroughTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator false ; - knora-base:mappingHasXMLTagname "strike"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass knora-base:StandoffUriTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator false ; - knora-base:mappingHasXMLTagname "a"^^xsd:string ; - knora-base:mappingHasStandoffDataTypeClass . - - - a knora-base:MappingStandoffDataTypeClass ; - knora-base:mappingHasStandoffClass knora-base:StandoffUriTag ; - knora-base:mappingHasXMLAttributename "href"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass knora-base:StandoffLinkTag ; - knora-base:mappingHasXMLClass "salsah-link" ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator false ; - knora-base:mappingHasXMLTagname "a"^^xsd:string ; - knora-base:mappingHasStandoffDataTypeClass . - - - a knora-base:MappingStandoffDataTypeClass ; - knora-base:mappingHasStandoffClass knora-base:StandoffLinkTag ; - knora-base:mappingHasXMLAttributename "href"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass knora-base:StandoffInternalReferenceTag ; - knora-base:mappingHasXMLClass "internal-link" ; - knora-base:mappingHasXMLNamespace "noNamespace" ; - knora-base:mappingElementRequiresSeparator false ; - knora-base:mappingHasXMLTagname "a" ; - knora-base:mappingHasStandoffDataTypeClass . - - - a knora-base:MappingStandoffDataTypeClass ; - knora-base:mappingHasStandoffClass knora-base:StandoffInternalReferenceTag ; - knora-base:mappingHasXMLAttributename "href" . - - -###################### additional elements - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffHeader1Tag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "h1"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffHeader2Tag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "h2"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasStandoffClass standoff:StandoffHeader3Tag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingHasXMLTagname "h3"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffHeader4Tag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "h4"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffHeader5Tag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "h5"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffHeader6Tag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "h6"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffOrderedListTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "ol"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffUnorderedListTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "ul"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffListElementTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "li"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffTableTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "table"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffTableBodyTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "tbody"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffTableRowTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "tr"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffTableCellTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "td"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffBrTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "br"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffLineTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingHasXMLTagname "hr"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffPreTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingHasXMLTagname "pre"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffCiteTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingHasXMLTagname "cite"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffBlockquoteTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "blockquote"^^xsd:string . - - - a knora-base:MappingElement ; - knora-base:mappingHasStandoffClass standoff:StandoffCodeTag ; - knora-base:mappingHasXMLClass "noClass"^^xsd:string ; - knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ; - knora-base:mappingElementRequiresSeparator true ; - knora-base:mappingHasXMLTagname "code"^^xsd:string . - -### TEI Mapping for standard standoff tags - - a knora-base:XMLToStandoffMapping ; - rdfs:label "mapping for TEI"@en . - - . - - a ; - "text" ; - "noNamespace" ; - "noClass" ; - ; - . - - a ; - "noNamespace" ; - "documentType" ; - . - - "false"^^xsd:boolean . - - . - - a ; - "entity" ; - "noNamespace" ; - "noClass" ; - ; - . - - a ; - ; - "ref" . - - "false"^^xsd:boolean . - - . - - a ; - "a" ; - "noNamespace" ; - "noClass" ; - ; - . - - a ; - ; - "href" . - - "false"^^xsd:boolean . - - . - - a ; - "ref" ; - "noNamespace" ; - "noClass" ; - ; - . - - a ; - ; - "target" . - - "false"^^xsd:boolean . - - . - - a ; - "quote" ; - "noNamespace" ; - "noClass" ; - ; - "false"^^xsd:boolean . - - . - - a ; - "code" ; - "noNamespace" ; - "noClass" ; - ; - "false"^^xsd:boolean . - - . - - a ; - "p" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "header1" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "header2" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "header3" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "header4" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "header5" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "header6" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "ol" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "ul" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "listitem" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "table" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "tablebody" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "row" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "cell" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "br" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "cite" ; - "noNamespace" ; - "noClass" ; - ; - "true"^^xsd:boolean . - - . - - a ; - "em" ; - "noNamespace" ; - "noClass" ; - ; - "false"^^xsd:boolean . - - . - - a ; - "b" ; - "noNamespace" ; - "noClass" ; - ; - "false"^^xsd:boolean . - - . - - a ; - "u" ; - "noNamespace" ; - "noClass" ; - ; - "false"^^xsd:boolean . - - . - - a ; - "strike" ; - "noNamespace" ; - "noClass" ; - ; - "false"^^xsd:boolean . - - . - - a ; - "sup" ; - "noNamespace" ; - "noClass" ; - ; - "false"^^xsd:boolean . - - . - - a ; - "sub" ; - "noNamespace" ; - "noClass" ; - ; - "false"^^xsd:boolean . - - . - - a ; - "line" ; - "noNamespace" ; - "noClass" ; - ; - "false"^^xsd:boolean . - - . - - a ; - "pre" ; - "noNamespace" ; - "noClass" ; - ; - "false"^^xsd:boolean . diff --git a/upgrade/plugins/pr1440/knora-ontologies/standoff-onto.ttl b/upgrade/plugins/pr1440/knora-ontologies/standoff-onto.ttl deleted file mode 100644 index f5113c5028..0000000000 --- a/upgrade/plugins/pr1440/knora-ontologies/standoff-onto.ttl +++ /dev/null @@ -1,356 +0,0 @@ -# Copyright © 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - -@prefix xml: . -@prefix xsd: . -@prefix rdf: . -@prefix rdfs: . -@prefix owl: . -@prefix foaf: . -@prefix knora-base: . -@prefix knora-admin: . -@prefix salsah-gui: . -@base . - -@prefix : . - - rdf:type owl:Ontology ; - - rdfs:label "The standoff ontology"@en ; - - knora-base:attachedToProject knora-admin:SystemProject . - - -################################################################# -# -# Standoff Properties -# -################################################################# - -### http://www.knora.org/ontology/standoff#standoffRootTagHasDocumentType - -:standoffRootTagHasDocumentType rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "describes the document type"@en ; - - knora-base:subjectClassConstraint :StandoffRootTag ; - - knora-base:objectDatatypeConstraint xsd:string . - - -### http://www.knora.org/ontology/standoff#standoffHyperlinkTagHasTarget - -:standoffHyperlinkTagHasTarget rdf:type owl:DatatypeProperty ; - - rdfs:subPropertyOf knora-base:objectCannotBeMarkedAsDeleted ; - - rdfs:comment "describes the target settings of a hyperlink"@en ; - - knora-base:subjectClassConstraint :StandoffHyperlinkTag ; - - knora-base:objectDatatypeConstraint xsd:string . - - -################################################################# -# -# Intermediate Standoff Tags -# -################################################################# - -### http://www.knora.org/ontology/standoff#StandoffVisualTag - -:StandoffVisualTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag ; - - rdfs:comment "Represents visual markup information in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffStructuralTag - -:StandoffStructuralTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag ; - - rdfs:comment "Represents structural markup information in a TextValue"@en . - - -################################################################# -# -# Standoff Tags that can be instantiated -# -################################################################# - - -### http://www.knora.org/ontology/standoff#StandoffRootTag - -:StandoffRootTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffRootTagHasDocumentType ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents the root node if the TextValue has been created from XML"@en . - -### http://www.knora.org/ontology/standoff#StandoffHyperlinkTag - -:StandoffHyperlinkTag rdf:type owl:Class ; - - rdfs:subClassOf knora-base:StandoffUriTag , - [ rdf:type owl:Restriction ; - owl:onProperty :standoffHyperlinkTagHasTarget ; - owl:maxCardinality "1"^^xsd:nonNegativeInteger - ] ; - - rdfs:comment "Represents a hyperlink in a text"@en . - -### http://www.knora.org/ontology/standoff#StandoffBlockquoteTag - -:StandoffBlockquoteTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a section that is quoted from another source in a text"@en . - - -### http://www.knora.org/ontology/standoff#StandoffCodeTag - -:StandoffCodeTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a section of computer source code in a text"@en . - - -### http://www.knora.org/ontology/standoff#StandoffParagraphTag - -:StandoffParagraphTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a paragraph in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader1Tag - -:StandoffHeader1Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 1 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader2Tag - -:StandoffHeader2Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 2 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader3Tag - -:StandoffHeader3Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 3 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader4Tag - -:StandoffHeader4Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 4 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader5Tag - -:StandoffHeader5Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 5 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffHeader6Tag - -:StandoffHeader6Tag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a header of level 6 in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffOrderedListTag - -:StandoffOrderedListTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents an ordered list in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffUnorderedListTag - -:StandoffUnorderedListTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents an unordered list in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffListElementTag - -:StandoffListElementTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a list element in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableBodyTag - -:StandoffTableBodyTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a table body in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableTag - -:StandoffTableTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a table in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableRowTag - -:StandoffTableRowTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a row in a table"@en . - - -### http://www.knora.org/ontology/standoff#StandoffTableCellTag - -:StandoffTableCellTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a cell in a table"@en . - - -### http://www.knora.org/ontology/standoff#StandoffBrTag - -:StandoffBrTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents a linebreak"@en . - - - -### http://www.knora.org/ontology/standoff#StandoffItalicTag - -:StandoffItalicTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents italics in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffBoldTag - -:StandoffBoldTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents bold text in a TextValue"@en . - -### http://www.knora.org/ontology/standoff-html-editor#StandoffCiteTag - -:StandoffCiteTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffStructuralTag ; - - rdfs:comment "Represents the title of a work in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffUnderlineTag - -:StandoffUnderlineTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents underlined text in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffStrikethroughTag - -:StandoffStrikethroughTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents struck text in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffSuperscriptTag - -:StandoffSuperscriptTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents superscript in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff#StandoffSubscriptTag - -:StandoffSubscriptTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents subscript in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff-html-editor#StandoffLineTag - -:StandoffLineTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents a line to seperate content in a TextValue"@en . - - -### http://www.knora.org/ontology/standoff-html-editor#StandoffPreTag - -:StandoffPreTag rdf:type owl:Class ; - - rdfs:subClassOf :StandoffVisualTag ; - - rdfs:comment "Represents a preformatted content in a TextValue"@en . diff --git a/upgrade/plugins/pr1440/update.py b/upgrade/plugins/pr1440/update.py deleted file mode 100644 index db6f636b60..0000000000 --- a/upgrade/plugins/pr1440/update.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright @ 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - - -from updatelib import rdftools - - -class GraphTransformer(rdftools.GraphTransformer): - def transform(self, graph): - # Nothing to do, because this plugin only updates the built-in ontologies. - return graph diff --git a/upgrade/src/main/scala/org.knora.upgrade/Main.scala b/upgrade/src/main/scala/org.knora.upgrade/Main.scala new file mode 100644 index 0000000000..cde15e3a34 --- /dev/null +++ b/upgrade/src/main/scala/org.knora.upgrade/Main.scala @@ -0,0 +1,259 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.upgrade + +import java.io._ + +import org.eclipse.rdf4j.model.impl.{LinkedHashModel, SimpleValueFactory} +import org.eclipse.rdf4j.model.util.Models +import org.eclipse.rdf4j.model.{Model, Statement} +import org.eclipse.rdf4j.rio.helpers.StatementCollector +import org.eclipse.rdf4j.rio.{RDFFormat, RDFParser, Rio} +import org.knora.upgrade.plugins._ +import org.knora.webapi.util.{Debug, FileUtil} +import org.knora.webapi.util.JavaUtil._ +import org.knora.webapi.{InconsistentTriplestoreDataException, OntologyConstants} +import org.rogach.scallop._ + +import scala.collection.JavaConverters._ +import scala.io.{BufferedSource, Codec, Source} + + +/** + * Updates a dump of a Knora repository to accommodate changes in Knora. + */ +object Main extends App { + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * A list of all plugins in chronological order. + */ + val pluginsForVersions: Seq[PluginForKnoraBaseVersion] = Seq( + PluginForKnoraBaseVersion(versionNumber = 1, plugin = new UpgradePluginPR1307, prBasedVersionString = Some("PR 1307")), + PluginForKnoraBaseVersion(versionNumber = 2, plugin = new UpgradePluginPR1322, prBasedVersionString = Some("PR 1322")), + PluginForKnoraBaseVersion(versionNumber = 3, plugin = new UpgradePluginPR1367, prBasedVersionString = Some("PR 1367")), + PluginForKnoraBaseVersion(versionNumber = 4, plugin = new UpgradePluginPR1372, prBasedVersionString = Some("PR 1372")), + PluginForKnoraBaseVersion(versionNumber = 5, plugin = new NoopPlugin, prBasedVersionString = Some("PR 1440")) + ) + + /** + * The built-in named graphs that are always updated when there is a new version of knora-base. + */ + val builtInNamedGraphs: Set[BuiltInNamedGraph] = Set( + BuiltInNamedGraph( + filename = "knora-ontologies/knora-admin.ttl", + iri = "http://www.knora.org/ontology/knora-admin" + ), + BuiltInNamedGraph( + filename = "knora-ontologies/knora-base.ttl", + iri = "http://www.knora.org/ontology/knora-base" + ), + BuiltInNamedGraph( + filename = "knora-ontologies/salsah-gui.ttl", + iri = "http://www.knora.org/ontology/salsah-gui" + ), + BuiltInNamedGraph( + filename = "knora-ontologies/standoff-onto.ttl", + iri = "http://www.knora.org/ontology/standoff" + ), + BuiltInNamedGraph( + filename = "knora-ontologies/standoff-data.ttl", + iri = "http://www.knora.org/data/standoff" + ) + ) + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Represents an update plugin with its knora-base version number and version string. + * + * @param versionNumber the knora-base version number that the plugin's transformation produces. + * @param plugin the plugin. + * @param prBasedVersionString the plugin's PR-based version string (not used for new plugins). + */ + case class PluginForKnoraBaseVersion(versionNumber: Int, plugin: UpgradePlugin, prBasedVersionString: Option[String] = None) { + lazy val versionString: String = { + prBasedVersionString match { + case Some(str) => str + case None => s"knora-base v$versionNumber" + } + } + } + + /** + * Represents a Knora built-in named graph. + * + * @param filename the filename containing the named graph. + * @param iri the IRI of the named graph. + */ + case class BuiltInNamedGraph(filename: String, iri: String) + + // Debug.printResources(builtInNamedGraphs.map(_.filename).toSeq) + + /** + * Constructs RDF4J values. + */ + val valueFactory = SimpleValueFactory.getInstance + + /** + * A map of version strings to plugins. + */ + val pluginsForVersionsMap: Map[String, PluginForKnoraBaseVersion] = pluginsForVersions.map { + knoraBaseVersion => knoraBaseVersion.versionString -> knoraBaseVersion + }.toMap + + // Parse the command-line arguments. + val conf = new TransformDataConf(args) + val inputFile = new File(conf.input()) + val outputFile = new File(conf.output()) + + // Parse the input file. + println("Reading input file...") + val model = readFileIntoModel(inputFile, RDFFormat.TRIG) + println(s"Read ${model.size} statements.") + + // Get the repository's version string, if any. + val maybeRepositoryVersionString: Option[String] = Models.getPropertyLiteral( + model, + valueFactory.createIRI(OntologyConstants.KnoraBase.KnoraBaseOntologyIri), + valueFactory.createIRI(OntologyConstants.KnoraBase.OntologyVersion) + ).toOption.map(_.stringValue) + + // Is the repository up to date? + if (maybeRepositoryVersionString.contains(org.knora.webapi.KnoraBaseVersion)) { + // Yes. Nothing more to do. + println(s"Repository is up to date at version ${org.knora.webapi.KnoraBaseVersion}.") + } else { + // No. Construct the list of updates that it needs. + val pluginsForNeededUpdates: Seq[PluginForKnoraBaseVersion] = maybeRepositoryVersionString match { + case Some(repositoryVersion) => + // The repository has a version string. Get the plugins for all subsequent versions. + val pluginForRepositoryVersion: PluginForKnoraBaseVersion = pluginsForVersionsMap.getOrElse( + repositoryVersion, + throw InconsistentTriplestoreDataException(s"No such repository version $repositoryVersion") + ) + + pluginsForVersions.filter(_.versionNumber > pluginForRepositoryVersion.versionNumber) + + case None => + // The repository has no version string. Include all updates. + pluginsForVersions + } + + println(s"Needed transformations: ${pluginsForNeededUpdates.map(_.versionString).mkString(", ")}") + + // Run the update plugins. + for (pluginForNeededUpdate <- pluginsForNeededUpdates) { + println(s"Running transformation for ${pluginForNeededUpdate.versionString}...") + pluginForNeededUpdate.plugin.transform(model) + } + + // Update the built-in named graphs. + + println("Updating built-in named graphs...") + + for (builtInNamedGraph <- builtInNamedGraphs) { + val context = valueFactory.createIRI(builtInNamedGraph.iri) + model.remove(null, null, null, context) + + val namedGraphModel: Model = readResourceIntoModel(builtInNamedGraph.filename, RDFFormat.TURTLE) + + // Set the context on each statement. + for (statement: Statement <- namedGraphModel.asScala.toSet) { + namedGraphModel.remove( + statement.getSubject, + statement.getPredicate, + statement.getObject, + statement.getContext + ) + + namedGraphModel.add( + statement.getSubject, + statement.getPredicate, + statement.getObject, + context + ) + } + + model.addAll(namedGraphModel) + } + + // Write the output file. + println(s"Writing output file (${model.size} statements)...") + val fileWriter = new FileWriter(outputFile) + val bufferedWriter = new BufferedWriter(fileWriter) + Rio.write(model, fileWriter, RDFFormat.TRIG) + bufferedWriter.close() + fileWriter.close() + } + + /** + * Reads an RDF file into a [[Model]]. + * + * @param file the file. + * @param format the file format. + * @return a [[Model]] representing the contents of the file. + */ + def readFileIntoModel(file: File, format: RDFFormat): Model = { + val fileReader = new FileReader(file) + val bufferedReader = new BufferedReader(fileReader) + val model = new LinkedHashModel() + val trigParser: RDFParser = Rio.createParser(format) + trigParser.setRDFHandler(new StatementCollector(model)) + trigParser.parse(bufferedReader, "") + fileReader.close() + bufferedReader.close() + model + } + + /** + * Reads a file from the CLASSPATH into a [[Model]]. + * + * @param filename the filename. + * @param format the file format. + * @return a [[Model]] representing the contents of the file. + */ + def readResourceIntoModel(filename: String, format: RDFFormat): Model = { + val fileContent: String = FileUtil.readTextResource(filename) + val stringReader = new StringReader(fileContent) + val model = new LinkedHashModel() + val trigParser: RDFParser = Rio.createParser(format) + trigParser.setRDFHandler(new StatementCollector(model)) + trigParser.parse(stringReader, "") + model + } + + /** + * Parses command-line arguments. + */ + class TransformDataConf(arguments: Seq[String]) extends ScallopConf(arguments) { + banner( + s""" + |Updates a dump of a repository to accommodate changes in Knora. + | + |Usage: org.knora.webapi.util.UpdateRepository input output + """.stripMargin) + + val input: ScallopOption[String] = trailArg[String](required = true, descr = "Input TriG file") + val output: ScallopOption[String] = trailArg[String](required = true, descr = "Output TriG file") + verify() + } + +} diff --git a/upgrade/src/main/scala/org.knora.upgrade/UpgradePlugin.scala b/upgrade/src/main/scala/org.knora.upgrade/UpgradePlugin.scala new file mode 100644 index 0000000000..2c4093a3dd --- /dev/null +++ b/upgrade/src/main/scala/org.knora.upgrade/UpgradePlugin.scala @@ -0,0 +1,34 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.upgrade + +import org.eclipse.rdf4j.model.Model + +/** + * A trait for plugins that update a repository. + */ +trait UpgradePlugin { + /** + * Transforms a repository. + * + * @param model a [[Model]] containing the repository data. + */ + def transform(model: Model): Unit +} diff --git a/upgrade/src/main/scala/org.knora.upgrade/plugins/NoopPlugin.scala b/upgrade/src/main/scala/org.knora.upgrade/plugins/NoopPlugin.scala new file mode 100644 index 0000000000..3317622074 --- /dev/null +++ b/upgrade/src/main/scala/org.knora.upgrade/plugins/NoopPlugin.scala @@ -0,0 +1,30 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.upgrade.plugins + +import org.eclipse.rdf4j.model.Model +import org.knora.upgrade.UpgradePlugin + +/** + * An update plugin that does nothing. Used for updates in which only the built-in named graphs have changed. + */ +class NoopPlugin extends UpgradePlugin { + override def transform(model: Model): Unit = {} +} diff --git a/upgrade/src/main/scala/org.knora.upgrade/plugins/UpgradePluginPR1307.scala b/upgrade/src/main/scala/org.knora.upgrade/plugins/UpgradePluginPR1307.scala new file mode 100644 index 0000000000..a289b6702e --- /dev/null +++ b/upgrade/src/main/scala/org.knora.upgrade/plugins/UpgradePluginPR1307.scala @@ -0,0 +1,197 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.upgrade.plugins + +import org.eclipse.rdf4j.model.impl.SimpleValueFactory +import org.eclipse.rdf4j.model.util.Models +import org.eclipse.rdf4j.model.vocabulary.RDF +import org.eclipse.rdf4j.model.{IRI, Model, Statement, Value} +import org.knora.upgrade.UpgradePlugin +import org.knora.webapi.util.JavaUtil._ +import org.knora.webapi.{InconsistentTriplestoreDataException, OntologyConstants} + +import scala.collection.JavaConverters._ + +/** + * Transforms a repository for Knora PR 1307. + */ +class UpgradePluginPR1307 extends UpgradePlugin { + private val valueFactory = SimpleValueFactory.getInstance + + // RDF4J IRI objects representing the IRIs used in this transformation. + private val TextValueIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.TextValue) + private val ValueHasStandoffIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.ValueHasStandoff) + private val StandoffTagHasStartIndexIri : IRI= valueFactory.createIRI(OntologyConstants.KnoraBase.StandoffTagHasStartIndex) + private val StandoffTagHasStartParentIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.StandoffTagHasStartParent) + private val StandoffTagHasEndParentIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.StandoffTagHasEndParent) + private val ValueHasMaxStandoffStartIndexIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.ValueHasMaxStandoffStartIndex) + + /** + * Represents a standoff tag to be transformed. + * + * @param oldIri the tag's old IRI. + * @param statements the statements about the tag. + */ + case class StandoffRdf(oldIri: IRI, statements: Model) { + /** + * The value of knora-base:standoffTagHasStartIndex. + */ + val startIndex: Int = Models.getPropertyLiteral(statements, oldIri, StandoffTagHasStartIndexIri).toOption match { + case Some(index) => index.intValue + case None => throw InconsistentTriplestoreDataException(s"$oldIri has no knora-base:standoffTagHasStartIndex") + } + + /** + * The tag's new IRI. + */ + lazy val newIri: IRI = { + val oldSubjStr: String = oldIri.stringValue + val slashPos: Int = oldSubjStr.lastIndexOf('/') + valueFactory.createIRI(oldSubjStr.substring(0, slashPos + 1) + startIndex.toString) + } + + def transform(model: Model, standoff: Map[IRI, StandoffRdf]): Unit = { + for (statement: Statement <- statements.asScala.toSet) { + // Change statements with knora-base:standoffTagHasStartParent and knora-base:standoffTagHasEndParent to point + // to the new IRIs of those tags. + val newStatementObj: Value = if (statement.getPredicate == StandoffTagHasStartParentIri || statement.getPredicate == StandoffTagHasEndParentIri) { + val targetTagOldIri: IRI = valueFactory.createIRI(statement.getObject.stringValue) + standoff(targetTagOldIri).newIri + } else { + statement.getObject + } + + // Remove each statement that uses this tag's old IRI. + model.remove( + oldIri, + statement.getPredicate, + statement.getObject, + statement.getContext + ) + + // Replace it with a statement that uses this tag's new IRI. + model.add( + newIri, + statement.getPredicate, + newStatementObj, + statement.getContext + ) + } + } + } + + /** + * Represents a `knora-base:TextValue` to be transformed. + * + * @param iri the text value's IRI. + * @param context the text value's context. + * @param valueHasStandoffStatements the statements whose subject is the text value and whose predicate is + * `knora-base:valueHasStandoff`. + * @param standoff the standoff tags attached to this text value, as a map of old standoff tag IRIs to + * [[StandoffRdf]] objects. + */ + case class TextValueRdf(iri: IRI, context: IRI, valueHasStandoffStatements: Model, standoff: Map[IRI, StandoffRdf]) { + def transform(model: Model): Unit = { + // Transform the text value's standoff tags. + for (standoffTag <- standoff.values) { + standoffTag.transform(model = model, standoff = standoff) + } + + if (standoff.nonEmpty) { + for (statement: Statement <- valueHasStandoffStatements.asScala.toSet) { + // Replace each statement in valueHasStandoffStatements with one that points to the standoff + // tag's new IRI. + + val targetTagOldIri: IRI = valueFactory.createIRI(statement.getObject.stringValue) + val targetTagNewIri: IRI = standoff(targetTagOldIri).newIri + + model.remove( + iri, + statement.getPredicate, + statement.getObject, + statement.getContext + ) + + model.add( + iri, + statement.getPredicate, + targetTagNewIri, + statement.getContext + ) + } + + // Add a statement to the text value with the predicate knora-base:valueHasMaxStandoffStartIndex. + model.add( + iri, + ValueHasMaxStandoffStartIndexIri, + valueFactory.createLiteral(new java.math.BigInteger(standoff.values.map(_.startIndex).max.toString)), + context + ) + } + } + } + + override def transform(model: Model): Unit = { + for (textValue <- collectTextValues(model)) { + textValue.transform(model) + } + } + + /** + * Collects the text values and standoff tags in the repository. + */ + private def collectTextValues(model: Model): Vector[TextValueRdf] = { + // Pairs of text value IRI and text value context. + val textValueSubjectsAndContexts: Vector[(IRI, IRI)] = model.filter(null, RDF.TYPE, TextValueIri).asScala.map { + statement => + (valueFactory.createIRI(statement.getSubject.stringValue), valueFactory.createIRI(statement.getContext.stringValue)) + }.toVector + + textValueSubjectsAndContexts.map { + case (textValueSubj: IRI, textValueContext: IRI) => + // Get the statements about the text value. + val textValueStatements: Model = model.filter(textValueSubj, null, null) + + // Get the statements whose subject is the text value and whose predicate is knora-base:valueHasStandoff. + val valueHasStandoffStatements: Model = textValueStatements.filter(null, ValueHasStandoffIri, null) + + // Get the IRIs of the text value's standoff tags. + val standoffSubjects: Set[IRI] = valueHasStandoffStatements.objects.asScala.map { + value => valueFactory.createIRI(value.stringValue) + }.toSet + + // Make a map of standoff IRIs to StandoffRdf objects. + val standoff: Map[IRI, StandoffRdf] = standoffSubjects.map { + standoffSubj: IRI => + standoffSubj -> StandoffRdf( + oldIri = standoffSubj, + statements = model.filter(standoffSubj, null, null) + ) + }.toMap + + TextValueRdf( + iri = textValueSubj, + context = textValueContext, + valueHasStandoffStatements = valueHasStandoffStatements, + standoff = standoff + ) + } + } +} diff --git a/upgrade/src/main/scala/org.knora.upgrade/plugins/UpgradePluginPR1322.scala b/upgrade/src/main/scala/org.knora.upgrade/plugins/UpgradePluginPR1322.scala new file mode 100644 index 0000000000..efd7166df4 --- /dev/null +++ b/upgrade/src/main/scala/org.knora.upgrade/plugins/UpgradePluginPR1322.scala @@ -0,0 +1,63 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.upgrade.plugins + +import org.eclipse.rdf4j.model.impl.SimpleValueFactory +import org.eclipse.rdf4j.model.{IRI, Model, Resource} +import org.knora.webapi.OntologyConstants +import org.knora.upgrade.UpgradePlugin +import org.knora.webapi.util.StringFormatter + +import scala.collection.JavaConverters._ + +/** + * Transforms a repository for Knora PR 1322. + */ +class UpgradePluginPR1322 extends UpgradePlugin { + private val valueFactory = SimpleValueFactory.getInstance + private implicit val stringFormatter: StringFormatter = StringFormatter.getInstanceForConstantOntologies + + // RDF4J IRI objects representing the IRIs used in this transformation. + private val ValueHasUUIDIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.ValueHasUUID) + private val ValueCreationDateIri : IRI= valueFactory.createIRI(OntologyConstants.KnoraBase.ValueCreationDate) + private val PreviousValueIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.PreviousValue) + + override def transform(model: Model): Unit = { + // Add a random UUID to each current value version. + for (valueIri: IRI <- collectCurrentValueIris(model)) { + model.add( + valueIri, + ValueHasUUIDIri, + valueFactory.createLiteral(stringFormatter.makeRandomBase64EncodedUuid) + ) + } + } + + /** + * Collects the IRIs of all values that are current value versions. + */ + private def collectCurrentValueIris(model: Model): Set[IRI] = { + model.filter(null, ValueCreationDateIri, null).subjects.asScala.toSet.filter { + resource: Resource => model.filter(null, PreviousValueIri, resource).asScala.toSet.isEmpty + }.map { + resource: Resource => valueFactory.createIRI(resource.stringValue) + } + } +} diff --git a/upgrade/src/main/scala/org.knora.upgrade/plugins/UpgradePluginPR1367.scala b/upgrade/src/main/scala/org.knora.upgrade/plugins/UpgradePluginPR1367.scala new file mode 100644 index 0000000000..3f0783c652 --- /dev/null +++ b/upgrade/src/main/scala/org.knora.upgrade/plugins/UpgradePluginPR1367.scala @@ -0,0 +1,62 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.upgrade.plugins + +import org.eclipse.rdf4j.model.impl.SimpleValueFactory +import org.eclipse.rdf4j.model.{IRI, Literal, Model, Statement} +import org.knora.upgrade.UpgradePlugin + +import scala.collection.JavaConverters._ + +/** + * Transforms a repository for Knora PR 1367. + */ +class UpgradePluginPR1367 extends UpgradePlugin { + private val valueFactory = SimpleValueFactory.getInstance + + // RDF4J IRI objects representing the IRIs used in this transformation. + private val XsdValueHasDecimalIri: IRI = valueFactory.createIRI("http://www.w3.org/2001/XMLSchema#valueHasDecimal") + + override def transform(model: Model): Unit = { + // Fix the datatypes of decimal literals. + for (statement: Statement <- model.asScala.toSet) { + statement.getObject match { + case literal: Literal => + if (literal.getDatatype == XsdValueHasDecimalIri) { + model.remove( + statement.getSubject, + statement.getPredicate, + statement.getObject, + statement.getContext + ) + + model.add( + statement.getSubject, + statement.getPredicate, + valueFactory.createLiteral(BigDecimal(statement.getObject.stringValue).underlying), + statement.getContext + ) + } + + case _ => () + } + } + } +} diff --git a/upgrade/src/main/scala/org.knora.upgrade/plugins/UpgradePluginPR1372.scala b/upgrade/src/main/scala/org.knora.upgrade/plugins/UpgradePluginPR1372.scala new file mode 100644 index 0000000000..f6eb977ef8 --- /dev/null +++ b/upgrade/src/main/scala/org.knora.upgrade/plugins/UpgradePluginPR1372.scala @@ -0,0 +1,61 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.upgrade.plugins + +import org.eclipse.rdf4j.model.impl.SimpleValueFactory +import org.eclipse.rdf4j.model.{IRI, Model, Resource} +import org.knora.webapi.OntologyConstants +import org.knora.upgrade.UpgradePlugin + +import scala.collection.JavaConverters._ + +/** + * Transforms a repository for Knora PR 1372. + */ +class UpgradePluginPR1372 extends UpgradePlugin { + private val valueFactory = SimpleValueFactory.getInstance + + // RDF4J IRI objects representing the IRIs used in this transformation. + private val ValueCreationDateIri : IRI= valueFactory.createIRI(OntologyConstants.KnoraBase.ValueCreationDate) + private val PreviousValueIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.PreviousValue) + private val HasPermissionsIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.HasPermissions) + + override def transform(model: Model): Unit = { + // Remove knora-base:hasPermissions from all past value versions. + for (valueIri: IRI <- collectPastValueIris(model)) { + model.remove( + valueIri, + HasPermissionsIri, + null + ) + } + } + + /** + * Collects the IRIs of all values that are past value versions. + */ + private def collectPastValueIris(model: Model): Set[IRI] = { + model.filter(null, ValueCreationDateIri, null).subjects.asScala.toSet.filter { + resource: Resource => model.filter(null, PreviousValueIri, resource).asScala.toSet.nonEmpty + }.map { + resource: Resource => valueFactory.createIRI(resource.stringValue) + } + } +} diff --git a/upgrade/src/test/resources/test-data/pr1307.trig b/upgrade/src/test/resources/test-data/pr1307.trig new file mode 100644 index 0000000000..a260d149ac --- /dev/null +++ b/upgrade/src/test/resources/test-data/pr1307.trig @@ -0,0 +1,100 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix owl: . +@prefix knora-base: . +@prefix knora-admin: . +@prefix standoff: . +@prefix anything: . + + { + a anything:Thing; + rdfs:label "Something with a lot of markup"; + knora-base:isDeleted false; + knora-base:attachedToProject ; + knora-base:creationDate "2018-05-30T13:44:11.749Z"^^xsd:dateTime; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:KnownUser|RV knora-admin:UnknownUser"; + knora-base:attachedToUser ; + anything:hasRichtext . + + a knora-base:TextValue; + knora-base:isDeleted false; + knora-base:valueHasStandoff , + , + , + , + , + , + , + ; + knora-base:valueHasMapping ; + knora-base:valueCreationDate "2018-05-30T13:44:11.749Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "Something with a lot of different markup. And more markup."; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:KnownUser|RV knora-admin:UnknownUser"; + knora-base:attachedToUser . + + + a standoff:StandoffBoldTag; + knora-base:standoffTagHasStart 0; + knora-base:standoffTagHasEnd 9; + knora-base:standoffTagHasStartIndex 2; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "7f3af890-c77d-4bf8-a81c-6786632520dd" . + + + a standoff:StandoffSuperscriptTag; + knora-base:standoffTagHasStart 34; + knora-base:standoffTagHasEnd 40; + knora-base:standoffTagHasStartIndex 6; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "e2ab65d2-6c80-494e-88ba-66767ed885f9" . + + + a standoff:StandoffParagraphTag; + knora-base:standoffTagHasStart 0; + knora-base:standoffTagHasEnd 58; + knora-base:standoffTagHasStartIndex 1; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "f3c0773a-2eb3-4d2e-9a6f-c8f2582a146e" . + + + a knora-base:StandoffUriTag; + knora-base:standoffTagHasStart 51; + knora-base:standoffTagHasEnd 57; + knora-base:standoffTagHasStartIndex 7; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "7b9f4609-3ba6-43e5-b945-d4329a155ca7"; + knora-base:valueHasUri "http://www.google.ch"^^xsd:anyURI . + + + a standoff:StandoffUnderlineTag; + knora-base:standoffTagHasStart 24; + knora-base:standoffTagHasEnd 33; + knora-base:standoffTagHasStartIndex 5; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "df348cfa-c362-45e6-9e13-601442214064" . + + + a standoff:StandoffRootTag; + knora-base:standoffTagHasStart 0; + knora-base:standoffTagHasEnd 59; + knora-base:standoffTagHasStartIndex 0; + knora-base:standoffTagHasUUID "c41e4e78-8b4f-47fc-9d17-8af0a279c80c" . + + + a standoff:StandoffItalicTag; + knora-base:standoffTagHasStart 10; + knora-base:standoffTagHasEnd 14; + knora-base:standoffTagHasStartIndex 3; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "13f66d42-2b1f-4fb4-91aa-6c55e350b0f4" . + + + a standoff:StandoffStrikethroughTag; + knora-base:standoffTagHasStart 17; + knora-base:standoffTagHasEnd 20; + knora-base:standoffTagHasStartIndex 4; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "0aaa6e47-0e9b-494f-9b6a-f42c66471d30" . +} diff --git a/upgrade/src/test/resources/test-data/pr1322.trig b/upgrade/src/test/resources/test-data/pr1322.trig new file mode 100644 index 0000000000..c3d8cc7662 --- /dev/null +++ b/upgrade/src/test/resources/test-data/pr1322.trig @@ -0,0 +1,75 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix owl: . +@prefix knora-base: . +@prefix knora-admin: . +@prefix anything: . + + { + a anything:Thing; + knora-base:isDeleted false; + knora-base:attachedToUser ; + knora-base:attachedToProject ; + rdfs:label "A thing with version history"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:creationDate "2019-02-08T15:05:10Z"^^xsd:dateTime; + knora-base:lastModificationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; + anything:hasInteger ; + anything:hasText . + + a knora-base:IntValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-11T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasInteger 1; + knora-base:valueHasOrder 0; + knora-base:valueHasString "1"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser . + + a knora-base:IntValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-12T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasInteger 2; + knora-base:valueHasOrder 0; + knora-base:valueHasString "2"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:IntValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasInteger 3; + knora-base:valueHasOrder 0; + knora-base:valueHasString "3"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:TextValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-10T10:05:10Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "one"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser . + + a knora-base:TextValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-11T10:05:10Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "two"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:TextValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-12T10:05:10Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "three"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . +} diff --git a/upgrade/src/test/resources/test-data/pr1367.trig b/upgrade/src/test/resources/test-data/pr1367.trig new file mode 100644 index 0000000000..fc02d1671a --- /dev/null +++ b/upgrade/src/test/resources/test-data/pr1367.trig @@ -0,0 +1,28 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix owl: . +@prefix knora-base: . +@prefix knora-admin: . +@prefix anything: . + + { + a anything:Thing; + knora-base:isDeleted false; + knora-base:attachedToUser ; + knora-base:attachedToProject ; + rdfs:label "A thing with a decimal value"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:creationDate "2019-02-08T15:05:10Z"^^xsd:dateTime; + knora-base:lastModificationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; + anything:hasDecimal . + + a knora-base:DecimalValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-11T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasDecimal "1.2"^^xsd:valueHasDecimal; + knora-base:valueHasOrder 0; + knora-base:valueHasString "1.2"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser . +} diff --git a/upgrade/src/test/resources/test-data/pr1372.trig b/upgrade/src/test/resources/test-data/pr1372.trig new file mode 100644 index 0000000000..ff3ec1a66b --- /dev/null +++ b/upgrade/src/test/resources/test-data/pr1372.trig @@ -0,0 +1,105 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix owl: . +@prefix knora-base: . +@prefix knora-admin: . +@prefix anything: . + + { + a anything:Thing; + knora-base:isDeleted false; + knora-base:attachedToUser ; + knora-base:attachedToProject ; + rdfs:label "A thing with version history"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:creationDate "2019-02-08T15:05:10Z"^^xsd:dateTime; + knora-base:lastModificationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; + anything:hasInteger ; + anything:hasText ; + anything:hasOtherThing ; + anything:hasOtherThingValue . + + a knora-base:IntValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-11T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasInteger 1; + knora-base:valueHasOrder 0; + knora-base:valueHasString "1"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser . + + a knora-base:IntValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-12T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasInteger 2; + knora-base:valueHasOrder 0; + knora-base:valueHasString "2"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:IntValue; + knora-base:valueHasUUID "pLlW4ODASumZfZFbJdpw1g"^^xsd:string; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasInteger 3; + knora-base:valueHasOrder 0; + knora-base:valueHasString "3"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:TextValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-10T10:05:10Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "one"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser . + + a knora-base:TextValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-11T10:05:10Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "two"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:TextValue; + knora-base:valueHasUUID "W5fm67e0QDWxRZumcXcs6g"^^xsd:string; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-12T10:05:10Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "three"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:LinkValue; + rdf:subject ; + rdf:predicate anything:hasOtherThing; + rdf:object ; + knora-base:isDeleted false; + knora-base:attachedToUser ; + knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember"; + knora-base:valueCreationDate "2019-02-10T10:30:10Z"^^xsd:dateTime; + knora-base:valueHasString "http://rdfh.ch/0001/2qMtTWvVRXWMBcRNlduvCQ"; + knora-base:valueHasRefCount 1 . + + a knora-base:LinkValue; + knora-base:valueHasUUID "IZGOjVqxTfSNO4ieKyp0SA"^^xsd:string; + rdf:subject ; + rdf:predicate anything:hasOtherThing; + rdf:object ; + knora-base:isDeleted true; + knora-base:deleteDate "2019-02-13T09:00:10Z"^^xsd:dateTime; + knora-base:deletedBy ; + knora-base:attachedToUser ; + knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember"; + knora-base:valueCreationDate "2019-02-13T09:00:10Z"^^xsd:dateTime; + knora-base:valueHasString "http://rdfh.ch/0001/2qMtTWvVRXWMBcRNlduvCQ"; + knora-base:valueHasRefCount 0; + knora-base:previousValue . +} diff --git a/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginPR1307Spec.scala b/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginPR1307Spec.scala new file mode 100644 index 0000000000..944e0f2750 --- /dev/null +++ b/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginPR1307Spec.scala @@ -0,0 +1,158 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.upgrade.plugins + +import org.eclipse.rdf4j.model.Model +import org.eclipse.rdf4j.repository.sail.SailRepository +import org.knora.webapi.messages.store.triplestoremessages.{SparqlSelectResponse, SparqlSelectResponseBody} + +class UpgradePluginPR1307Spec extends UpgradePluginSpec { + "Upgrade plugin PR1307" should { + "update text values with standoff" in { + // Parse the input file. + val model: Model = trigFileToModel("src/test/resources/test-data/pr1307.trig") + + // Use the plugin to transform the input. + val plugin = new UpgradePluginPR1307 + plugin.transform(model) + + // Make an in-memory repository containing the transformed model. + val repository: SailRepository = makeRepository(model) + val connection = repository.getConnection + + // Check that knora-base:valueHasMaxStandoffStartIndex was added. + + val query1: String = + """ + |PREFIX knora-base: + | + |SELECT ?s ?maxStartIndex WHERE { + | ?s knora-base:valueHasMaxStandoffStartIndex ?maxStartIndex . + |} + |""".stripMargin + + val queryResult1: SparqlSelectResponse = doSelect(selectQuery = query1, connection = connection) + + val expectedResult1: SparqlSelectResponseBody = expectedResult( + Seq( + Map( + "s" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ", + "maxStartIndex" -> "7" + ) + ) + ) + + assert(queryResult1.results == expectedResult1) + + // Check that the standoff tags' IRIs were changed correctly. + + val query2: String = + """ + |PREFIX knora-base: + | + |SELECT ?tag WHERE { + | knora-base:valueHasStandoff ?tag . + |} ORDER BY ?tag + |""".stripMargin + + val queryResult2: SparqlSelectResponse = doSelect(selectQuery = query2, connection = connection) + + val expectedResult2: SparqlSelectResponseBody = expectedResult( + Seq( + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/0"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/2"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/3"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/4"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/5"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/6"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/7") + ) + ) + + assert(queryResult2.results == expectedResult2) + + // Check that the objects of knora-base:standoffTagHasStartParent were changed correctly. + + val query3: String = + """ + |PREFIX knora-base: + | + |SELECT ?tag ?startIndex ?startParent WHERE { + | ?tag knora-base:standoffTagHasStartIndex ?startIndex . + | + | OPTIONAL { + | ?tag knora-base:standoffTagHasStartParent ?startParent . + | } + |} ORDER BY ?tag + |""".stripMargin + + val queryResult3: SparqlSelectResponse = doSelect(selectQuery = query3, connection = connection) + + val expectedResult3: SparqlSelectResponseBody = expectedResult( + Seq( + Map( + "startIndex" -> "0", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/0" + ), + Map( + "startIndex" -> "1", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/0", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1" + ), + Map( + "startIndex" -> "2", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/2" + ), + Map( + "startIndex" -> "3", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/3" + ), + Map( + "startIndex" -> "4", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/4" + ), + Map( + "startIndex" -> "5", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/5" + ), + Map( + "startIndex" -> "6", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/6" + ), + Map( + "startIndex" -> "7", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/7" + ) + ) + ) + + assert(queryResult3.results == expectedResult3) + connection.close() + repository.shutDown() + } + } +} diff --git a/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginPR1322Spec.scala b/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginPR1322Spec.scala new file mode 100644 index 0000000000..0c27071526 --- /dev/null +++ b/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginPR1322Spec.scala @@ -0,0 +1,70 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.upgrade.plugins + +import org.eclipse.rdf4j.model.Model +import org.eclipse.rdf4j.repository.sail.SailRepository +import org.knora.webapi.messages.store.triplestoremessages.{SparqlSelectResponse, SparqlSelectResponseBody} + +class UpgradePluginPR1322Spec extends UpgradePluginSpec { + "Upgrade plugin PR1322" should { + "add UUIDs to values" in { + // Parse the input file. + val model: Model = trigFileToModel("src/test/resources/test-data/pr1322.trig") + + // Use the plugin to transform the input. + val plugin = new UpgradePluginPR1322 + plugin.transform(model) + + // Make an in-memory repository containing the transformed model. + val repository: SailRepository = makeRepository(model) + val connection = repository.getConnection + + // Check that UUIDs were added. + + val query: String = + """ + |PREFIX knora-base: + | + |SELECT ?value WHERE { + | ?value knora-base:valueHasUUID ?valueHasUUID . + |} ORDER BY ?value + |""".stripMargin + + val queryResult1: SparqlSelectResponse = doSelect(selectQuery = query, connection = connection) + + val expectedResultBody: SparqlSelectResponseBody = expectedResult( + Seq( + Map( + "value" -> "http://rdfh.ch/0001/thing-with-history/values/1c" + ), + Map( + "value" -> "http://rdfh.ch/0001/thing-with-history/values/2c" + ) + ) + ) + + assert(queryResult1.results == expectedResultBody) + + connection.close() + repository.shutDown() + } + } +} diff --git a/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginPR1367Spec.scala b/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginPR1367Spec.scala new file mode 100644 index 0000000000..f8694c2aa1 --- /dev/null +++ b/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginPR1367Spec.scala @@ -0,0 +1,50 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.upgrade.plugins + +import org.eclipse.rdf4j.model.impl.SimpleValueFactory +import org.eclipse.rdf4j.model.util.Models +import org.eclipse.rdf4j.model.{Literal, Model} +import org.knora.webapi.OntologyConstants +import org.knora.webapi.util.JavaUtil._ + +class UpgradePluginPR1367Spec extends UpgradePluginSpec { + private val valueFactory = SimpleValueFactory.getInstance + + "Upgrade plugin PR1367" should { + "fix the datatypes of decimal literals" in { + // Parse the input file. + val model: Model = trigFileToModel("src/test/resources/test-data/pr1367.trig") + + // Use the plugin to transform the input. + val plugin = new UpgradePluginPR1367 + plugin.transform(model) + + // Check that the decimal datatype was fixed. + val literal: Literal = Models.getPropertyLiteral( + model, + valueFactory.createIRI("http://rdfh.ch/0001/thing-with-history/values/1"), + valueFactory.createIRI(OntologyConstants.KnoraBase.ValueHasDecimal) + ).toOption.get + + assert(literal.getDatatype == valueFactory.createIRI(OntologyConstants.Xsd.Decimal)) + } + } +} diff --git a/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginPR1372Spec.scala b/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginPR1372Spec.scala new file mode 100644 index 0000000000..5815996892 --- /dev/null +++ b/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginPR1372Spec.scala @@ -0,0 +1,74 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.upgrade.plugins + +import org.eclipse.rdf4j.model.Model +import org.eclipse.rdf4j.repository.sail.SailRepository +import org.knora.webapi.messages.store.triplestoremessages.{SparqlSelectResponse, SparqlSelectResponseBody} + +class UpgradePluginPR1372Spec extends UpgradePluginSpec { + "Upgrade plugin PR1372" should { + "remove permissions from past versions of values" in { + // Parse the input file. + val model: Model = trigFileToModel("src/test/resources/test-data/pr1372.trig") + + // Use the plugin to transform the input. + val plugin = new UpgradePluginPR1372 + plugin.transform(model) + + // Make an in-memory repository containing the transformed model. + val repository: SailRepository = makeRepository(model) + val connection = repository.getConnection + + // Check that permissions were removed. + + val query: String = + """ + |PREFIX knora-base: + | + |SELECT ?value WHERE { + | ?value knora-base:valueCreationDate ?creationDate ; + | knora-base:hasPermissions ?permissions . + |} ORDER BY ?value + |""".stripMargin + + val queryResult1: SparqlSelectResponse = doSelect(selectQuery = query, connection = connection) + + val expectedResultBody: SparqlSelectResponseBody = expectedResult( + Seq( + Map( + "value" -> "http://rdfh.ch/0001/thing-with-history/values/1c" + ), + Map( + "value" -> "http://rdfh.ch/0001/thing-with-history/values/2c" + ), + Map( + "value" -> "http://rdfh.ch/0001/thing-with-history/values/3b" + ) + ) + ) + + assert(queryResult1.results == expectedResultBody) + + connection.close() + repository.shutDown() + } + } +} diff --git a/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginSpec.scala b/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginSpec.scala new file mode 100644 index 0000000000..3eff21eecb --- /dev/null +++ b/upgrade/src/test/scala/org.knora.upgrade/plugins/UpgradePluginSpec.scala @@ -0,0 +1,117 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.upgrade.plugins + +import java.io.{BufferedReader, FileReader} + +import org.eclipse.rdf4j.model.Model +import org.eclipse.rdf4j.model.impl.LinkedHashModel +import org.eclipse.rdf4j.query.{Binding, TupleQuery, TupleQueryResult} +import org.eclipse.rdf4j.repository.sail.{SailRepository, SailRepositoryConnection} +import org.eclipse.rdf4j.rio.helpers.StatementCollector +import org.eclipse.rdf4j.rio.{RDFFormat, RDFParser, Rio} +import org.eclipse.rdf4j.sail.memory.MemoryStore +import org.knora.webapi.messages.store.triplestoremessages.{SparqlSelectResponse, SparqlSelectResponseBody, SparqlSelectResponseHeader, VariableResultsRow} +import org.knora.webapi.util.ErrorHandlingMap +import org.scalatest.{Matchers, WordSpecLike} + +import scala.collection.JavaConverters._ +import scala.collection.mutable.ArrayBuffer + +/** + * Provides helper methods for specs that test upgrade plugins. + */ +abstract class UpgradePluginSpec extends WordSpecLike with Matchers { + /** + * Parses a TriG file and returns it as an RDF4J [[Model]]. + * + * @param path the file path of the TriG file. + * @return a [[Model]]. + */ + def trigFileToModel(path: String): Model = { + val trigParser: RDFParser = Rio.createParser(RDFFormat.TRIG) + val fileReader = new BufferedReader(new FileReader(path)) + val model = new LinkedHashModel() + trigParser.setRDFHandler(new StatementCollector(model)) + trigParser.parse(fileReader, "") + model + } + + /** + * Makes an in-memory RDF4J [[SailRepository]] containing a [[Model]]. + * + * @param model the model to be added to the repository. + * @return the repository. + */ + def makeRepository(model: Model): SailRepository = { + val repository = new SailRepository(new MemoryStore()) + repository.init() + val connection: SailRepositoryConnection = repository.getConnection + connection.add(model) + connection.close() + repository + } + + /** + * Wraps expected SPARQL SELECT results in a [[SparqlSelectResponseBody]]. + * + * @param rows the expected results. + * @return a [[SparqlSelectResponseBody]] containing the expected results. + */ + def expectedResult(rows: Seq[Map[String, String]]): SparqlSelectResponseBody = { + val rowMaps = rows.map { + mapToWrap => VariableResultsRow(new ErrorHandlingMap[String, String](mapToWrap, { key: String => s"No value found for SPARQL query variable '$key' in query result row" })) + } + + SparqlSelectResponseBody(bindings = rowMaps) + } + + /** + * Does a SPARQL SELECT query using a connection to an RDF4J [[SailRepository]]. + * + * @param selectQuery the query. + * @param connection a connection to the repository. + * @return a [[SparqlSelectResponse]] containing the query results. + */ + def doSelect(selectQuery: String, connection: SailRepositoryConnection): SparqlSelectResponse = { + val tupleQuery: TupleQuery = connection.prepareTupleQuery(selectQuery) + val tupleQueryResult: TupleQueryResult = tupleQuery.evaluate + + val header = SparqlSelectResponseHeader(tupleQueryResult.getBindingNames.asScala) + val rowBuffer = ArrayBuffer.empty[VariableResultsRow] + + while (tupleQueryResult.hasNext) { + val bindings: Iterable[Binding] = tupleQueryResult.next.asScala + + val rowMap: Map[String, String] = bindings.map { + binding => binding.getName -> binding.getValue.stringValue + }.toMap + + rowBuffer.append(VariableResultsRow(new ErrorHandlingMap[String, String](rowMap, { key: String => s"No value found for SPARQL query variable '$key' in query result row" }))) + } + + tupleQueryResult.close() + + SparqlSelectResponse( + head = header, + results = SparqlSelectResponseBody(bindings = rowBuffer) + ) + } +} diff --git a/upgrade/test.sh b/upgrade/test.sh deleted file mode 100755 index 5eaaad8414..0000000000 --- a/upgrade/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -python3 -W ignore::DeprecationWarning -m pytest diff --git a/upgrade/update-repository.py b/upgrade/update-repository.py deleted file mode 100755 index de3c210606..0000000000 --- a/upgrade/update-repository.py +++ /dev/null @@ -1,360 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright @ 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - - -import os -import time -from datetime import timedelta -import tempfile -import argparse -import getpass -import rdflib -import importlib -import re -from updatelib import rdftools - - -# A list of built-in Knora ontologies and data files. -knora_ontologies = [ - { - "filename": "knora-admin.ttl", - "context": "http://www.knora.org/ontology/knora-admin" - }, - { - "filename": "knora-base.ttl", - "context": "http://www.knora.org/ontology/knora-base" - }, - { - "filename": "salsah-gui.ttl", - "context": "http://www.knora.org/ontology/salsah-gui" - }, - { - "filename": "standoff-onto.ttl", - "context": "http://www.knora.org/ontology/standoff" - }, - { - "filename": "standoff-data.ttl", - "context": "http://www.knora.org/data/standoff" - } -] - -# A set of the IRIs of the named graphs containing built-in Knora ontologies. -knora_ontology_contexts = set([onto["context"] for onto in knora_ontologies]) - -# A regex that matches the object of knora-base:ontologyVersion. -knora_base_version_string_regex = re.compile(r"^PR ([0-9]+)$") - -# A regex that matches the name of a directory containing an update plugin. -plugin_dirname_regex = re.compile(r"^pr([0-9]+)$") - - -# Represents information about a GraphDB repository. -class GraphDBInfo: - def __init__(self, graphdb_host, repository, username, password): - self.graphdb_url = "http://{}:7200/repositories/{}".format(graphdb_host, repository) - self.contexts_url = self.graphdb_url + "/contexts" - self.statements_url = self.graphdb_url + "/statements" - self.username = username - self.password = password - - -# Represents a named graph. -class NamedGraph: - def __init__(self, context, graphdb_info, filename=None): - self.context = context - self.uri = "<" + context + ">" - self.graphdb_info = graphdb_info - - if filename is not None: - self.filename = filename - else: - self.filename = context.translate({ord(c): None for c in "/:"}) + ".ttl" - - self.namespaces = [] - - # Downloads the named graph from the repository to a file in download_dir. - def download(self, download_dir): - print("Downloading named graph {}...".format(self.context)) - downloaded_file_path = download_dir + "/" + self.filename - rdftools.do_download_request(graphdb_info=self.graphdb_info, context=self.uri, file_path=downloaded_file_path) - - # Parses the input graph. - def parse(self, download_dir): - print("Parsing input file for named graph {}...".format(self.context)) - input_file_path = download_dir + "/" + self.filename - graph = rdflib.Graph() - graph.parse(source=input_file_path, format="turtle") - self.namespaces = list(graph.namespace_manager.namespaces()) - return graph - - # Formats the output graph. - def format(self, graph, upload_dir): - for prefix, namespace in self.namespaces: - graph.namespace_manager.bind(prefix=prefix, namespace=namespace, override=True, replace=True) - - output_file_path = upload_dir + "/" + self.filename - print("Writing transformed file...") - graph.serialize(destination=output_file_path, format="turtle") - - def to_turtle_file(self, upload_dir): - return rdftools.TurtleFile( - context=rdflib.URIRef(self.context), - namespaces=self.namespaces, - file_path=upload_dir + "/" + self.filename - ) - - -# Represents a repository. -class Repository: - def __init__(self, graphdb_info): - self.graphdb_info = graphdb_info - self.named_graphs = [] - - # Downloads the repository, saving the named graphs in files in download_dir. - def download(self, download_dir): - print("Downloading named graphs...") - contexts = rdftools.do_contexts_request(graphdb_info=self.graphdb_info) - - for context in contexts: - if not (context in knora_ontology_contexts): - named_graph = NamedGraph(context=context, graphdb_info=self.graphdb_info) - named_graph.download(download_dir) - self.named_graphs.append(named_graph) - - print("Downloaded named graphs to", download_dir) - - # Uses a GraphTransformer to transform the named graphs in download_dir, saving the output in upload_dir. - def transform(self, graph_transformer, download_dir, upload_dir): - print("Transforming data...") - - for named_graph in self.named_graphs: - input_graph = named_graph.parse(download_dir) - graph_size = len(input_graph) - print("Transforming {} statements...".format(graph_size)) - output_graph = graph_transformer.transform(input_graph) - named_graph.format(output_graph, upload_dir) - - print("Wrote transformed data to " + upload_dir) - - # Deletes the contents of the repository. - def empty(self): - print("Emptying repository...") - rdftools.do_update_request(graphdb_info=self.graphdb_info, sparql="DROP ALL") - print("Emptied repository.") - - # Uploads the PR-specific knora ontologies and transformed named graphs to the repository. - def upload(self, knora_ontologies_dir, upload_dir): - print("Combining named graphs...") - - # Make a TurtleFile for each built-in Knora ontology. - - turtle_files = [] - - for ontology in knora_ontologies: - ontology_named_graph = NamedGraph( - context=ontology["context"], - graphdb_info=self.graphdb_info, - filename=ontology["filename"] - ) - - turtle_files.append(ontology_named_graph.to_turtle_file(knora_ontologies_dir)) - - # Make a TurtleFile for each transformed named graph. - - for named_graph in self.named_graphs: - turtle_files.append(named_graph.to_turtle_file(upload_dir)) - - # Upload the whole repository. - - trig_file_path = upload_dir + "/repository.trig" - - rdftools.do_upload_request( - graphdb_info=self.graphdb_info, - turtle_files=turtle_files, - trig_file_path=trig_file_path - ) - - print("Uploaded repository.") - - # Updates the Lucene index. - def update_lucene_index(self): - print("Updating Lucene index...") - - sparql = """ - PREFIX luc: - INSERT DATA { luc:fullTextSearchIndex luc:updateIndex _:b1 . } - """ - - rdftools.do_update_request(graphdb_info=self.graphdb_info, sparql=sparql) - print("Updated Lucene index.") - - -# Updates the repository using the specified list of GraphTransformer instances. -def run_updates(graphdb_info, transformers): - repository = Repository(graphdb_info) - last_upload_dir = None - last_transformer = None - - for transformer in transformers: - temp_dir = tempfile.mkdtemp() - print("Running transformation for PR {}...".format(transformer.pr_num)) - print("Using temporary directory {}".format(temp_dir)) - - upload_dir = temp_dir + "/upload" - os.mkdir(upload_dir) - - # Is this the first transformation? - if last_upload_dir is not None: - # No. Use the result of the last transformation as input. - repository.transform(graph_transformer=transformer, download_dir=last_upload_dir, upload_dir=upload_dir) - else: - # Yes. Download the repository. - download_dir = temp_dir + "/download" - os.mkdir(download_dir) - repository.download(download_dir) - repository.transform(graph_transformer=transformer, download_dir=download_dir, upload_dir=upload_dir) - - last_upload_dir = upload_dir - last_transformer = transformer - print("Transformation for PR {} complete.".format(transformer.pr_num)) - - # Empty the repository. - repository.empty() - - # Upload the results of the last transformation. - last_transformer_knora_ontologies_dir = "plugins/pr{}/knora-ontologies".format(last_transformer.pr_num) - repository.upload(knora_ontologies_dir=last_transformer_knora_ontologies_dir, upload_dir=last_upload_dir) - repository.update_lucene_index() - - -# Determines which transformations need to be run, and returns a corresponding list of GraphTransformer instances. -def load_transformers(graphdb_info): - # Get the list of available transformations. - - plugins_subdirs = os.listdir("plugins") - pr_nums = [] - - for dirname in plugins_subdirs: - match = plugin_dirname_regex.match(dirname) - - if match is not None: - pr_nums.append(int(match.group(1))) - - # Get the version string attached to knora-base in the repository. - - knora_base_pr_num_sparql = """ - PREFIX knora-base: - - SELECT ?ontologyVersion - WHERE { - knora-base:ontologyVersion ?ontologyVersion . - } - """ - - query_result_rows = rdftools.do_select_request(graphdb_info=graphdb_info, sparql=knora_base_pr_num_sparql) - - # Did we find a version string? - if len(query_result_rows) > 0: - # Yes. Parse it. - - ontology_version_string = query_result_rows[0]["ontologyVersion"]["value"] - match = knora_base_version_string_regex.match(ontology_version_string) - - if match is None: - raise rdftools.UpdateException("Could not parse knora-base:ontologyVersion: {}".format(ontology_version_string)) - - print("Repository version: {}".format(ontology_version_string)) - repository_pr_num = int(match.group(1)) - else: - # No. Run all available transformations. - repository_pr_num = 0 - print("Repository has no knora-base:ontologyVersion.") - - # Make a sorted list of transformations needed for this repository. - needed_pr_nums = sorted(list(filter(lambda pr_num: pr_num > repository_pr_num, pr_nums))) - - # If the list of transformations is empty, do nothing. - if len(needed_pr_nums) == 0: - return [] - - needed_pr_nums_str = ', '.join(map(str, needed_pr_nums)) - print("Required updates: " + needed_pr_nums_str) - transformers = [] - - # Load a GraphTransformer instance for each transformation. - for transformer_pr_num in needed_pr_nums: - # Load the transformer's module. - transformer_module = importlib.import_module("plugins.pr{}.update".format(transformer_pr_num)) - - # Get the transformer class definition from the module. - transformer_class = getattr(transformer_module, "GraphTransformer") - - # Make an instance of the transformer class. - transformer = transformer_class() - - # Add its PR number to it. - transformer.pr_num = transformer_pr_num - - # Add it to the list. - transformers.append(transformer) - - return transformers - - -# Command-line invocation. -def main(): - default_graphdb_host = "localhost" - default_repository = "knora-test" - - parser = argparse.ArgumentParser(description="Updates a Knora repository.") - parser.add_argument("-g", "--graphdb", default=default_graphdb_host, help="GraphDB host (default '{}')".format(default_graphdb_host), type=str) - parser.add_argument("-r", "--repository", default=default_repository, help="GraphDB repository (default '{}')".format(default_repository), - type=str) - parser.add_argument("-u", "--username", help="GraphDB username", type=str, required=True) - parser.add_argument("-p", "--password", help="GraphDB password (if not provided, will prompt for password)", - type=str) - parser.add_argument("-t", "--tempdir", help="temporary directory", type=str) - - args = parser.parse_args() - password = args.password - - if not password: - password = getpass.getpass() - - graphdb_info = GraphDBInfo( - graphdb_host=args.graphdb, - repository=args.repository, - username=args.username, - password=password - ) - - start = time.time() - transformers = load_transformers(graphdb_info) - - if len(transformers) > 0: - tempfile.tempdir = args.tempdir - run_updates(graphdb_info=graphdb_info, transformers=transformers) - elapsed = time.time() - start - print("Update complete. Elapsed time: {}.".format(str(timedelta(seconds=elapsed)))) - else: - print("No updates needed.") - - -if __name__ == "__main__": - main() diff --git a/upgrade/updatelib/rdftools.py b/upgrade/updatelib/rdftools.py deleted file mode 100644 index bb99a92bfb..0000000000 --- a/upgrade/updatelib/rdftools.py +++ /dev/null @@ -1,220 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright @ 2015-2019 the contributors (see Contributors.md). -# -# This file is part of Knora. -# -# Knora 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. -# -# Knora 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 Knora. If not, see . - - -import requests -import rdflib -from collections import defaultdict -from abc import ABC, abstractmethod -import re - - -# An abstract class representing a PR-specific graph transformation. Each -# implementation must be in its own module and be called GraphTransformer. -class GraphTransformer(ABC): - @abstractmethod - def transform(self, graph): - pass - - -# Raised when an error occurs during an update. -class UpdateException(Exception): - def __init__(self, message): - self.message = message - - -# Makes a SELECT request to the triplestore, returning the result as a list of rows. -def do_select_request(graphdb_info, sparql): - headers = { - "Content-Type": "application/sparql-query", - "Accept": "application/sparql-results+json" - } - - response = requests.post( - url=graphdb_info.graphdb_url, - headers=headers, - data=sparql, - auth=(graphdb_info.username, graphdb_info.password) - ) - - response.raise_for_status() - json_response = response.json() - return json_response["results"]["bindings"] - - -# Makes an update request to the triplestore. -def do_update_request(graphdb_info, sparql): - headers = { - "Content-Type": "application/sparql-update" - } - - response = requests.post( - url=graphdb_info.statements_url, - headers=headers, - data=sparql, - auth=(graphdb_info.username, graphdb_info.password) - ) - - response.raise_for_status() - - -# Returns a list of available named graphs from the triplestore. -def do_contexts_request(graphdb_info): - response = requests.get( - url=graphdb_info.contexts_url, - auth=(graphdb_info.username, graphdb_info.password) - ) - - response.raise_for_status() - contexts = response.text.splitlines() - - if contexts[0] != "contextID": - raise UpdateException("Unexpected response from GraphDB:\n" + response.text) - - contexts.pop(0) - return contexts - - -# Downloads a named graph from the triplestore in Turtle format and saves it to a file. -def do_download_request(graphdb_info, context, file_path): - params = { - "infer": "false", - "context": context - } - - headers = { - "Accept": "text/turtle" - } - - response = requests.get( - url=graphdb_info.statements_url, - params=params, - headers=headers, - auth=(graphdb_info.username, graphdb_info.password) - ) - - response.raise_for_status() - - with open(file_path, "wb") as downloaded_file: - for chunk in response.iter_content(chunk_size=1024): - downloaded_file.write(chunk) - - -# Represents a file in Turtle format. -class TurtleFile: - def __init__(self, context, namespaces, file_path): - self.context = context - self.namespaces = namespaces - self.file_path = file_path - - -# A regex that matches the name of a Knora named graph that needs a prefix. -context_regex = re.compile(r"^http://www.knora.org/(.+)/(.+)/(.+)$") - - -# Given a collection of TurtleFiles, combines them into a Trig file and uploads that file to the triplestore. -def do_upload_request(graphdb_info, turtle_files, trig_file_path): - namespaces = { - "ontology": rdflib.URIRef("http://www.knora.org/ontology/"), - "data": rdflib.URIRef("http://www.knora.org/data/") - } - - for turtle_file in turtle_files: - namespaces.update(turtle_file.namespaces) - - # Add prefixes, otherwise rdflib will add random ones. - - context_str = str(turtle_file.context) - match = context_regex.match(context_str) - - if match is not None: - prefix = match.group(1) + "-" + match.group(2) - namespaces[prefix] = "http://www.knora.org/{}/{}/".format(match.group(1), match.group(2)) - - for prefix, namespace in namespaces.items(): - print("prefix {}: {}".format(prefix, namespace)) - - dataset = rdflib.Dataset() - - for turtle_file in turtle_files: - print("Reading named graph {}...".format(turtle_file.context)) - graph = dataset.graph(turtle_file.context) - graph.parse(source=turtle_file.file_path, format="turtle") - - for prefix, namespace in namespaces.items(): - dataset.namespace_manager.bind(prefix=prefix, namespace=namespace, override=True, replace=True) - - print("Writing repository file for upload...") - - dataset.serialize(destination=trig_file_path, format="trig") - - headers = { - "Content-Type": "application/trig" - } - - print("Uploading repository...") - - with open(trig_file_path, "r") as file_to_upload: - file_content = file_to_upload.read().encode("utf-8") - - response = requests.post( - url=graphdb_info.statements_url, - headers=headers, - auth=(graphdb_info.username, graphdb_info.password), - data=file_content - ) - - response.raise_for_status() - - -# Groups statements by subject and by predicate. -def group_statements(input_graph): - grouped_statements = {} - - for subj in input_graph.subjects(): - grouped_pred_objs = defaultdict(list) - - for pred, obj in input_graph.predicate_objects(subj): - grouped_pred_objs[pred].append(obj) - - grouped_statements[subj] = grouped_pred_objs - - return grouped_statements - - -# Ungroups statements. -def ungroup_statements(grouped_statements): - ungrouped_statements = rdflib.Graph() - - for subj, pred_objs in grouped_statements.items(): - for pred, objs in pred_objs.items(): - for obj in objs: - ungrouped_statements.add((subj, pred, obj)) - - return ungrouped_statements - - -# Returns true if the specified generator is empty. -def generator_is_empty(gen): - try: - next(gen) - except StopIteration: - return True - - return False diff --git a/webapi/src/it/resources/logback-test.xml b/webapi/src/it/resources/logback-test.xml index 5b75df9568..424181f100 100644 --- a/webapi/src/it/resources/logback-test.xml +++ b/webapi/src/it/resources/logback-test.xml @@ -55,7 +55,7 @@ - + diff --git a/webapi/src/main/resources/logback.xml b/webapi/src/main/resources/logback.xml index a0075e179e..3fd9c856ad 100644 --- a/webapi/src/main/resources/logback.xml +++ b/webapi/src/main/resources/logback.xml @@ -35,7 +35,7 @@ - + diff --git a/webapi/src/main/scala/org/knora/webapi/update/UpdatePlugin.scala b/webapi/src/main/scala/org/knora/webapi/update/UpdatePlugin.scala new file mode 100644 index 0000000000..bd66266d05 --- /dev/null +++ b/webapi/src/main/scala/org/knora/webapi/update/UpdatePlugin.scala @@ -0,0 +1,36 @@ +/* +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.webapi.update + +import org.eclipse.rdf4j.model.Model + +/** + * A trait for plugins that update a repository. + */ +trait UpdatePlugin { + /** + * Transforms a repository. + * + * @param model a [[Model]] containing the repository data. + */ + def transform(model: Model): Unit +} +*/ diff --git a/webapi/src/main/scala/org/knora/webapi/update/UpdateRepository.scala b/webapi/src/main/scala/org/knora/webapi/update/UpdateRepository.scala new file mode 100644 index 0000000000..7fcac9a8de --- /dev/null +++ b/webapi/src/main/scala/org/knora/webapi/update/UpdateRepository.scala @@ -0,0 +1,245 @@ +/* +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.webapi.update + +import java.io._ + +import org.eclipse.rdf4j.model.impl.{LinkedHashModel, SimpleValueFactory} +import org.eclipse.rdf4j.model.util.Models +import org.eclipse.rdf4j.model.{Model, Statement} +import org.eclipse.rdf4j.rio.helpers.StatementCollector +import org.eclipse.rdf4j.rio.{RDFFormat, RDFParser, Rio} +import org.knora.webapi.update.plugins._ +import org.knora.webapi.util.JavaUtil._ +import org.knora.webapi.{InconsistentTriplestoreDataException, OntologyConstants} +import org.rogach.scallop._ + +import scala.collection.JavaConverters._ + + +/** + * Updates a dump of a Knora repository to accommodate changes in Knora. + */ +object UpdateRepository extends App { + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * A list of all plugins in chronological order. + */ + val pluginsForVersions: Seq[PluginForKnoraBaseVersion] = Seq( + PluginForKnoraBaseVersion(versionNumber = 1, plugin = new UpdatePluginPR1307, prBasedVersionString = Some("PR 1307")), + PluginForKnoraBaseVersion(versionNumber = 2, plugin = new UpdatePluginPR1322, prBasedVersionString = Some("PR 1322")), + PluginForKnoraBaseVersion(versionNumber = 3, plugin = new UpdatePluginPR1367, prBasedVersionString = Some("PR 1367")), + PluginForKnoraBaseVersion(versionNumber = 4, plugin = new UpdatePluginPR1372, prBasedVersionString = Some("PR 1372")), + PluginForKnoraBaseVersion(versionNumber = 5, plugin = new NoopPlugin, prBasedVersionString = Some("PR 1440")) + ) + + /** + * The built-in named graphs that are always updated when there is a new version of knora-base. + */ + val builtInNamedGraphs: Set[BuiltInNamedGraph] = Set( + BuiltInNamedGraph( + filename = "knora-admin.ttl", + iri = "http://www.knora.org/ontology/knora-admin" + ), + BuiltInNamedGraph( + filename = "knora-base.ttl", + iri = "http://www.knora.org/ontology/knora-base" + ), + BuiltInNamedGraph( + filename = "salsah-gui.ttl", + iri = "http://www.knora.org/ontology/salsah-gui" + ), + BuiltInNamedGraph( + filename = "standoff-onto.ttl", + iri = "http://www.knora.org/ontology/standoff" + ), + BuiltInNamedGraph( + filename = "standoff-data.ttl", + iri = "http://www.knora.org/data/standoff" + ) + ) + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Represents an update plugin with its knora-base version number and version string. + * + * @param versionNumber the knora-base version number that the plugin's transformation produces. + * @param plugin the plugin. + * @param prBasedVersionString the plugin's PR-based version string (not used for new plugins). + */ + case class PluginForKnoraBaseVersion(versionNumber: Int, plugin: UpdatePlugin, prBasedVersionString: Option[String] = None) { + lazy val versionString: String = { + prBasedVersionString match { + case Some(str) => str + case None => s"knora-base v$versionNumber" + } + } + } + + /** + * Represents a Knora built-in named graph. + * + * @param filename the filename containing the named graph. + * @param iri the IRI of the named graph. + */ + case class BuiltInNamedGraph(filename: String, iri: String) + + /** + * Constructs RDF4J values. + */ + val valueFactory = SimpleValueFactory.getInstance + + /** + * A map of version strings to plugins. + */ + val pluginsForVersionsMap: Map[String, PluginForKnoraBaseVersion] = pluginsForVersions.map { + knoraBaseVersion => knoraBaseVersion.versionString -> knoraBaseVersion + }.toMap + + // Parse the command-line arguments. + val conf = new TransformDataConf(args) + val inputFile = new File(conf.input()) + val outputFile = new File(conf.output()) + + val updateStartTime = System.currentTimeMillis() + + // Parse the input file. + val parseStartTime = System.currentTimeMillis() + val model = readFileIntoModel(inputFile, RDFFormat.TRIG) + val parseEndTime = System.currentTimeMillis() + println(s"Parsed ${model.size} statements in ${parseEndTime - parseStartTime} ms") + + // Get the repository's version string, if any. + val maybeRepositoryVersionString: Option[String] = Models.getPropertyLiteral( + model, + valueFactory.createIRI(OntologyConstants.KnoraBase.KnoraBaseOntologyIri), + valueFactory.createIRI(OntologyConstants.KnoraBase.OntologyVersion) + ).toOption.map(_.stringValue) + + // Is the repository up to date? + if (maybeRepositoryVersionString.contains(org.knora.webapi.KnoraBaseVersion)) { + // Yes. Nothing more to do. + println(s"Repository is up to date at version ${org.knora.webapi.KnoraBaseVersion}.") + } else { + // No. Construct the list of updates that it needs. + val pluginsForNeededUpdates: Seq[PluginForKnoraBaseVersion] = maybeRepositoryVersionString match { + case Some(repositoryVersion) => + // The repository has a version string. Get the plugins for all subsequent versions. + val pluginForRepositoryVersion: PluginForKnoraBaseVersion = pluginsForVersionsMap.getOrElse( + repositoryVersion, + throw InconsistentTriplestoreDataException(s"No such repository version $repositoryVersion") + ) + + pluginsForVersions.filter(_.versionNumber > pluginForRepositoryVersion.versionNumber) + + case None => + // The repository has no version string. Include all updates. + pluginsForVersions + } + + println(s"Needed updates: ${pluginsForNeededUpdates.map(_.versionString).mkString(", ")}") + + // Run the update plugins. + for (pluginForNeededUpdate <- pluginsForNeededUpdates) { + println(s"Running update for ${pluginForNeededUpdate.versionString}...") + pluginForNeededUpdate.plugin.transform(model) + } + + // Update the built-in named graphs. + + println("Updating built-in named graphs...") + + for (builtInNamedGraph <- builtInNamedGraphs) { + println(s"<${builtInNamedGraph.iri}>...") + val context = valueFactory.createIRI(builtInNamedGraph.iri) + model.remove(null, null, null, context) + + val namedGraphTurtleFile = new File(s"../knora-ontologies/${builtInNamedGraph.filename}") + val namedGraphModel: Model = readFileIntoModel(namedGraphTurtleFile, RDFFormat.TURTLE) + + // Set the context on each statement. + for (statement: Statement <- namedGraphModel.asScala.toSet) { + namedGraphModel.remove( + statement.getSubject, + statement.getPredicate, + statement.getObject, + statement.getContext + ) + + namedGraphModel.add( + statement.getSubject, + statement.getPredicate, + statement.getObject, + context + ) + } + + model.addAll(namedGraphModel) + } + + // Write the output file. + println(s"Writing output file (${model.size} statements)...") + val fileWriter = new FileWriter(outputFile) + val bufferedWriter = new BufferedWriter(fileWriter) + Rio.write(model, fileWriter, RDFFormat.TRIG) + bufferedWriter.close() + fileWriter.close() + + val updateEndTime = System.currentTimeMillis + println(s"Update completed in ${updateEndTime - updateStartTime} ms.") + } + + /** + * Reads an RDF file into a [[Model]]. + * + * @param file the file. + * @param format the file format. + * @return a [[Model]] representing the contents of the file. + */ + def readFileIntoModel(file: File, format: RDFFormat): Model = { + val trigParser: RDFParser = Rio.createParser(format) + val fileReader = new FileReader(file) + val bufferedReader = new BufferedReader(fileReader) + val model = new LinkedHashModel() + trigParser.setRDFHandler(new StatementCollector(model)) + trigParser.parse(bufferedReader, "") + model + } + + /** + * Parses command-line arguments. + */ + class TransformDataConf(arguments: Seq[String]) extends ScallopConf(arguments) { + banner( + s""" + |Updates a dump of a repository to accommodate changes in Knora. + | + |Usage: org.knora.webapi.util.UpdateRepository input output + """.stripMargin) + + val input: ScallopOption[String] = trailArg[String](required = true, descr = "Input TriG file") + val output: ScallopOption[String] = trailArg[String](required = true, descr = "Output TriG file") + verify() + } +} +*/ diff --git a/webapi/src/main/scala/org/knora/webapi/update/plugins/NoopPlugin.scala b/webapi/src/main/scala/org/knora/webapi/update/plugins/NoopPlugin.scala new file mode 100644 index 0000000000..5ed915cf6f --- /dev/null +++ b/webapi/src/main/scala/org/knora/webapi/update/plugins/NoopPlugin.scala @@ -0,0 +1,32 @@ +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +/* +package org.knora.webapi.update.plugins + +import org.eclipse.rdf4j.model.Model +import org.knora.webapi.update.UpdatePlugin + +/** + * An update plugin that does nothing. Used for updates in which only the built-in named graphs have changed. + */ +class NoopPlugin extends UpdatePlugin { + override def transform(model: Model): Unit = {} +} +*/ diff --git a/webapi/src/main/scala/org/knora/webapi/update/plugins/UpdatePluginPR1307.scala b/webapi/src/main/scala/org/knora/webapi/update/plugins/UpdatePluginPR1307.scala new file mode 100644 index 0000000000..a3b777e3f6 --- /dev/null +++ b/webapi/src/main/scala/org/knora/webapi/update/plugins/UpdatePluginPR1307.scala @@ -0,0 +1,199 @@ +/* +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.webapi.update.plugins + +import org.eclipse.rdf4j.model.impl.SimpleValueFactory +import org.eclipse.rdf4j.model.util.Models +import org.eclipse.rdf4j.model.vocabulary.RDF +import org.eclipse.rdf4j.model.{IRI, Model, Statement, Value} +import org.knora.webapi.update.UpdatePlugin +import org.knora.webapi.util.JavaUtil._ +import org.knora.webapi.{InconsistentTriplestoreDataException, OntologyConstants} + +import scala.collection.JavaConverters._ + +/** + * Transforms a repository for Knora PR 1307. + */ +class UpdatePluginPR1307 extends UpdatePlugin { + private val valueFactory = SimpleValueFactory.getInstance + + // RDF4J IRI objects representing the IRIs used in this transformation. + private val TextValueIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.TextValue) + private val ValueHasStandoffIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.ValueHasStandoff) + private val StandoffTagHasStartIndexIri : IRI= valueFactory.createIRI(OntologyConstants.KnoraBase.StandoffTagHasStartIndex) + private val StandoffTagHasStartParentIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.StandoffTagHasStartParent) + private val StandoffTagHasEndParentIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.StandoffTagHasEndParent) + private val ValueHasMaxStandoffStartIndexIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.ValueHasMaxStandoffStartIndex) + + /** + * Represents a standoff tag to be transformed. + * + * @param oldIri the tag's old IRI. + * @param statements the statements about the tag. + */ + case class StandoffRdf(oldIri: IRI, statements: Model) { + /** + * The value of knora-base:standoffTagHasStartIndex. + */ + val startIndex: Int = Models.getPropertyLiteral(statements, oldIri, StandoffTagHasStartIndexIri).toOption match { + case Some(index) => index.intValue + case None => throw InconsistentTriplestoreDataException(s"$oldIri has no knora-base:standoffTagHasStartIndex") + } + + /** + * The tag's new IRI. + */ + lazy val newIri: IRI = { + val oldSubjStr: String = oldIri.stringValue + val slashPos: Int = oldSubjStr.lastIndexOf('/') + valueFactory.createIRI(oldSubjStr.substring(0, slashPos + 1) + startIndex.toString) + } + + def transform(model: Model, standoff: Map[IRI, StandoffRdf]): Unit = { + for (statement: Statement <- statements.asScala.toSet) { + // Change statements with knora-base:standoffTagHasStartParent and knora-base:standoffTagHasEndParent to point + // to the new IRIs of those tags. + val newStatementObj: Value = if (statement.getPredicate == StandoffTagHasStartParentIri || statement.getPredicate == StandoffTagHasEndParentIri) { + val targetTagOldIri: IRI = valueFactory.createIRI(statement.getObject.stringValue) + standoff(targetTagOldIri).newIri + } else { + statement.getObject + } + + // Remove each statement that uses this tag's old IRI. + model.remove( + oldIri, + statement.getPredicate, + statement.getObject, + statement.getContext + ) + + // Replace it with a statement that uses this tag's new IRI. + model.add( + newIri, + statement.getPredicate, + newStatementObj, + statement.getContext + ) + } + } + } + + /** + * Represents a `knora-base:TextValue` to be transformed. + * + * @param iri the text value's IRI. + * @param context the text value's context. + * @param valueHasStandoffStatements the statements whose subject is the text value and whose predicate is + * `knora-base:valueHasStandoff`. + * @param standoff the standoff tags attached to this text value, as a map of old standoff tag IRIs to + * [[StandoffRdf]] objects. + */ + case class TextValueRdf(iri: IRI, context: IRI, valueHasStandoffStatements: Model, standoff: Map[IRI, StandoffRdf]) { + def transform(model: Model): Unit = { + // Transform the text value's standoff tags. + for (standoffTag <- standoff.values) { + standoffTag.transform(model = model, standoff = standoff) + } + + if (standoff.nonEmpty) { + for (statement: Statement <- valueHasStandoffStatements.asScala.toSet) { + // Replace each statement in valueHasStandoffStatements with one that points to the standoff + // tag's new IRI. + + val targetTagOldIri: IRI = valueFactory.createIRI(statement.getObject.stringValue) + val targetTagNewIri: IRI = standoff(targetTagOldIri).newIri + + model.remove( + iri, + statement.getPredicate, + statement.getObject, + statement.getContext + ) + + model.add( + iri, + statement.getPredicate, + targetTagNewIri, + statement.getContext + ) + } + + // Add a statement to the text value with the predicate knora-base:valueHasMaxStandoffStartIndex. + model.add( + iri, + ValueHasMaxStandoffStartIndexIri, + valueFactory.createLiteral(new java.math.BigInteger(standoff.values.map(_.startIndex).max.toString)), + context + ) + } + } + } + + override def transform(model: Model): Unit = { + for (textValue <- collectTextValues(model)) { + textValue.transform(model) + } + } + + /** + * Collects the text values and standoff tags in the repository. + */ + private def collectTextValues(model: Model): Vector[TextValueRdf] = { + // Pairs of text value IRI and text value context. + val textValueSubjectsAndContexts: Vector[(IRI, IRI)] = model.filter(null, RDF.TYPE, TextValueIri).asScala.map { + statement => + (valueFactory.createIRI(statement.getSubject.stringValue), valueFactory.createIRI(statement.getContext.stringValue)) + }.toVector + + textValueSubjectsAndContexts.map { + case (textValueSubj: IRI, textValueContext: IRI) => + // Get the statements about the text value. + val textValueStatements: Model = model.filter(textValueSubj, null, null) + + // Get the statements whose subject is the text value and whose predicate is knora-base:valueHasStandoff. + val valueHasStandoffStatements: Model = textValueStatements.filter(null, ValueHasStandoffIri, null) + + // Get the IRIs of the text value's standoff tags. + val standoffSubjects: Set[IRI] = valueHasStandoffStatements.objects.asScala.map { + value => valueFactory.createIRI(value.stringValue) + }.toSet + + // Make a map of standoff IRIs to StandoffRdf objects. + val standoff: Map[IRI, StandoffRdf] = standoffSubjects.map { + standoffSubj: IRI => + standoffSubj -> StandoffRdf( + oldIri = standoffSubj, + statements = model.filter(standoffSubj, null, null) + ) + }.toMap + + TextValueRdf( + iri = textValueSubj, + context = textValueContext, + valueHasStandoffStatements = valueHasStandoffStatements, + standoff = standoff + ) + } + } +} +*/ diff --git a/webapi/src/main/scala/org/knora/webapi/update/plugins/UpdatePluginPR1322.scala b/webapi/src/main/scala/org/knora/webapi/update/plugins/UpdatePluginPR1322.scala new file mode 100644 index 0000000000..895b40bd31 --- /dev/null +++ b/webapi/src/main/scala/org/knora/webapi/update/plugins/UpdatePluginPR1322.scala @@ -0,0 +1,65 @@ +/* +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.webapi.update.plugins + +import org.eclipse.rdf4j.model.impl.SimpleValueFactory +import org.eclipse.rdf4j.model.{IRI, Model, Resource} +import org.knora.webapi.OntologyConstants +import org.knora.webapi.update.UpdatePlugin +import org.knora.webapi.util.StringFormatter + +import scala.collection.JavaConverters._ + +/** + * Transforms a repository for Knora PR 1322. + */ +class UpdatePluginPR1322 extends UpdatePlugin { + private val valueFactory = SimpleValueFactory.getInstance + private implicit val stringFormatter: StringFormatter = StringFormatter.getInstanceForConstantOntologies + + // RDF4J IRI objects representing the IRIs used in this transformation. + private val ValueHasUUIDIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.ValueHasUUID) + private val ValueCreationDateIri : IRI= valueFactory.createIRI(OntologyConstants.KnoraBase.ValueCreationDate) + private val PreviousValueIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.PreviousValue) + + override def transform(model: Model): Unit = { + // Add a random UUID to each current value version. + for (valueIri: IRI <- collectCurrentValueIris(model)) { + model.add( + valueIri, + ValueHasUUIDIri, + valueFactory.createLiteral(stringFormatter.makeRandomBase64EncodedUuid) + ) + } + } + + /** + * Collects the IRIs of all values that are current value versions. + */ + private def collectCurrentValueIris(model: Model): Set[IRI] = { + model.filter(null, ValueCreationDateIri, null).subjects.asScala.toSet.filter { + resource: Resource => model.filter(null, PreviousValueIri, resource).asScala.toSet.isEmpty + }.map { + resource: Resource => valueFactory.createIRI(resource.stringValue) + } + } +} +*/ diff --git a/webapi/src/main/scala/org/knora/webapi/update/plugins/UpdatePluginPR1367.scala b/webapi/src/main/scala/org/knora/webapi/update/plugins/UpdatePluginPR1367.scala new file mode 100644 index 0000000000..cbd9f141e3 --- /dev/null +++ b/webapi/src/main/scala/org/knora/webapi/update/plugins/UpdatePluginPR1367.scala @@ -0,0 +1,64 @@ +/* +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.webapi.update.plugins + +import org.eclipse.rdf4j.model.impl.SimpleValueFactory +import org.eclipse.rdf4j.model.{IRI, Literal, Model, Statement} +import org.knora.webapi.update.UpdatePlugin + +import scala.collection.JavaConverters._ + +/** + * Transforms a repository for Knora PR 1367. + */ +class UpdatePluginPR1367 extends UpdatePlugin { + private val valueFactory = SimpleValueFactory.getInstance + + // RDF4J IRI objects representing the IRIs used in this transformation. + private val XsdValueHasDecimalIri: IRI = valueFactory.createIRI("http://www.w3.org/2001/XMLSchema#valueHasDecimal") + + override def transform(model: Model): Unit = { + // Fix the datatypes of decimal literals. + for (statement: Statement <- model.asScala.toSet) { + statement.getObject match { + case literal: Literal => + if (literal.getDatatype == XsdValueHasDecimalIri) { + model.remove( + statement.getSubject, + statement.getPredicate, + statement.getObject, + statement.getContext + ) + + model.add( + statement.getSubject, + statement.getPredicate, + valueFactory.createLiteral(BigDecimal(statement.getObject.stringValue).underlying), + statement.getContext + ) + } + + case _ => () + } + } + } +} +*/ diff --git a/webapi/src/main/scala/org/knora/webapi/update/plugins/UpdatePluginPR1372.scala b/webapi/src/main/scala/org/knora/webapi/update/plugins/UpdatePluginPR1372.scala new file mode 100644 index 0000000000..fec4f2e7de --- /dev/null +++ b/webapi/src/main/scala/org/knora/webapi/update/plugins/UpdatePluginPR1372.scala @@ -0,0 +1,63 @@ +/* +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.webapi.update.plugins + +import org.eclipse.rdf4j.model.impl.SimpleValueFactory +import org.eclipse.rdf4j.model.{IRI, Model, Resource} +import org.knora.webapi.OntologyConstants +import org.knora.webapi.update.UpdatePlugin + +import scala.collection.JavaConverters._ + +/** + * Transforms a repository for Knora PR 1372. + */ +class UpdatePluginPR1372 extends UpdatePlugin { + private val valueFactory = SimpleValueFactory.getInstance + + // RDF4J IRI objects representing the IRIs used in this transformation. + private val ValueCreationDateIri : IRI= valueFactory.createIRI(OntologyConstants.KnoraBase.ValueCreationDate) + private val PreviousValueIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.PreviousValue) + private val HasPermissionsIri: IRI = valueFactory.createIRI(OntologyConstants.KnoraBase.HasPermissions) + + override def transform(model: Model): Unit = { + // Remove knora-base:hasPermissions from all past value versions. + for (valueIri: IRI <- collectPastValueIris(model)) { + model.remove( + valueIri, + HasPermissionsIri, + null + ) + } + } + + /** + * Collects the IRIs of all values that are past value versions. + */ + private def collectPastValueIris(model: Model): Set[IRI] = { + model.filter(null, ValueCreationDateIri, null).subjects.asScala.toSet.filter { + resource: Resource => model.filter(null, PreviousValueIri, resource).asScala.toSet.nonEmpty + }.map { + resource: Resource => valueFactory.createIRI(resource.stringValue) + } + } +} +*/ diff --git a/webapi/src/main/scala/org/knora/webapi/util/Debug.scala b/webapi/src/main/scala/org/knora/webapi/util/Debug.scala new file mode 100644 index 0000000000..65de568d1a --- /dev/null +++ b/webapi/src/main/scala/org/knora/webapi/util/Debug.scala @@ -0,0 +1,35 @@ +package org.knora.webapi.util + +/** + * Contains methods useful for debugging + */ +object Debug { + + /** + * prints out the classpath + */ + def printClasspath(): Unit = { + // debug classpath + def urls(cl: ClassLoader): Array[java.net.URL] = Option(cl) match { + case None => Array() + case Some(u: java.net.URLClassLoader) => u.getURLs ++ urls(cl.getParent) + case Some(_) => urls(cl.getParent) + } + val res = urls(getClass.getClassLoader) + println(res.filterNot(_.toString.contains("ivy")).mkString("\n")) + } + + /** + * Prints out the file paths for the resources + * + * @param resources a sequence of resource. + */ + def printResources(resources: Seq[String]): Unit = { + println(s"printing resources: $resources") + resources.foreach { res => + val url = getClass.getClassLoader.getResource(res) + println(url) + } + } + +} diff --git a/webapi/src/main/scala/org/knora/webapi/util/JavaUtil.scala b/webapi/src/main/scala/org/knora/webapi/util/JavaUtil.scala index 00151cad85..2c8bc595ad 100644 --- a/webapi/src/main/scala/org/knora/webapi/util/JavaUtil.scala +++ b/webapi/src/main/scala/org/knora/webapi/util/JavaUtil.scala @@ -21,6 +21,8 @@ package org.knora.webapi.util import java.util.function.{BiFunction, Function} +import scala.language.implicitConversions + /** * Utility functions for working with Java libraries. */ @@ -47,16 +49,16 @@ object JavaUtil { /** * Recursively converts a Java collection into a Scala collection. * - * Usage: val scalaObj = deepScalaToJava(javaObj).asInstanceOf[Map[String, Any]] + * Usage: `val scalaObj = deepScalaToJava(javaObj).asInstanceOf[Map[String, Any]]` * * @param javaObj the Java collection to be converted. * @return an equivalent Scala collection. */ - def deepJavatoScala(javaObj: Any): Any = { + def deepJavaToScala(javaObj: Any): Any = { import collection.JavaConverters._ javaObj match { - case x: java.util.HashMap[_, _] => x.asScala.toMap.mapValues(deepJavatoScala) - case x: java.util.ArrayList[_] => x.asScala.toList.map(deepJavatoScala) + case x: java.util.HashMap[_, _] => x.asScala.toMap.mapValues(deepJavaToScala) + case x: java.util.ArrayList[_] => x.asScala.toList.map(deepJavaToScala) case _ => javaObj } } @@ -88,4 +90,13 @@ object JavaUtil { object Optional { def unapply[T](a: T): Some[Option[T]] = if (null == a) Some(None) else Some(Some(a)) } + + /** + * Wraps a Java `Optional` and converts it to a Scala [[Option]]. + */ + class JavaOptional[T](opt: java.util.Optional[T]) { + def toOption: Option[T] = if (opt.isPresent) Some(opt.get()) else None + } + + implicit def toJavaOptional[T](optional: java.util.Optional[T]): JavaOptional[T] = new JavaOptional[T](optional) } diff --git a/webapi/src/main/scala/org/knora/webapi/util/StatementCollectingHandler.scala b/webapi/src/main/scala/org/knora/webapi/util/StatementCollectingHandler.scala deleted file mode 100644 index c845e18e48..0000000000 --- a/webapi/src/main/scala/org/knora/webapi/util/StatementCollectingHandler.scala +++ /dev/null @@ -1,83 +0,0 @@ -package org.knora.webapi.util - -import org.eclipse.rdf4j.model.impl.SimpleValueFactory -import org.eclipse.rdf4j.model.{Resource, Statement} -import org.eclipse.rdf4j.rio.{RDFHandler, RDFWriter} -import org.knora.webapi.{IRI, OntologyConstants} - -import scala.collection.immutable.TreeMap - -/** - * An abstract [[RDFHandler]] that collects all statements so they can be processed when the end of the - * input file is reached. Subclasses need to implement only `endRDF`, which must call `turtleWriter.endRDF()` - * when finished. - * - * @param turtleWriter an [[RDFWriter]] that writes to the output file. - */ -abstract class StatementCollectingHandler(turtleWriter: RDFWriter) extends RDFHandler { - /** - * An instance of [[SimpleValueFactory]] for creating RDF statements. - */ - protected val valueFactory: SimpleValueFactory = SimpleValueFactory.getInstance() - - implicit object ResourceOrdering extends Ordering[Resource] { - def compare(o1: Resource, o2: Resource): Int = o1.stringValue.compare(o2.stringValue) - } - - /** - * A collection of all the statements in the input file, grouped and sorted by subject IRI. - */ - protected var statements: TreeMap[Resource, Vector[Statement]] = TreeMap.empty[Resource, Vector[Statement]] - - /** - * A convenience method that returns the first object of the specified predicate in a list of statements. - * - * @param subjectStatements the statements to search. - * @param predicateIri the predicate to search for. - * @return the first object found for the specified predicate. - */ - protected def getObject(subjectStatements: Vector[Statement], predicateIri: IRI): Option[String] = { - subjectStatements.find(_.getPredicate.stringValue == predicateIri).map(_.getObject.stringValue) - } - - /** - * Adds a statement to the collection `statements`. - * - * @param st the statement to be added. - */ - override def handleStatement(st: Statement): Unit = { - val subject = st.getSubject - val currentStatementsForSubject = statements.getOrElse(subject, Vector.empty[Statement]) - - if (st.getPredicate.stringValue == OntologyConstants.Rdf.Type) { - // Make rdf:type the first statement for the subject. - statements += (subject -> (st +: currentStatementsForSubject)) - } else { - statements += (subject -> (currentStatementsForSubject :+ st)) - } - } - - /** - * Does nothing (comments are ignored). - * - * @param comment a Turtle comment. - */ - override def handleComment(comment: String): Unit = {} - - /** - * Writes the specified namespace declaration to the output file. - * - * @param prefix the namespace prefix. - * @param uri the namespace URI. - */ - override def handleNamespace(prefix: String, uri: String): Unit = { - turtleWriter.handleNamespace(prefix, uri) - } - - /** - * Calls `turtleWriter.startRDF()`. - */ - override def startRDF(): Unit = { - turtleWriter.startRDF() - } -} diff --git a/webapi/src/main/scala/org/knora/webapi/util/TransformData.scala b/webapi/src/main/scala/org/knora/webapi/util/TransformData.scala deleted file mode 100644 index 5232d77a72..0000000000 --- a/webapi/src/main/scala/org/knora/webapi/util/TransformData.scala +++ /dev/null @@ -1,658 +0,0 @@ -/* - * Copyright © 2015-2019 the contributors (see Contributors.md). - * - * This file is part of Knora. - * - * Knora 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. - * - * Knora 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 Knora. If not, see . - */ - -package org.knora.webapi.util - -import java.io._ - -import com.typesafe.scalalogging.Logger -import org.eclipse.rdf4j.model.impl.SimpleValueFactory -import org.eclipse.rdf4j.model.{Resource, Statement} -import org.eclipse.rdf4j.rio.turtle._ -import org.eclipse.rdf4j.rio.{RDFHandler, RDFWriter} -import org.knora.webapi.OntologyConstants.KnoraBase.KnoraBasePrefixExpansion -import org.knora.webapi.messages.admin.responder.permissionsmessages.{PermissionADM, PermissionType} -import org.knora.webapi.messages.v1.responder.valuemessages._ -import org.knora.webapi.util.PermissionUtilADM.EntityPermission -import org.knora.webapi.{IRI, InconsistentTriplestoreDataException, OntologyConstants} -import org.rogach.scallop._ -import org.slf4j.LoggerFactory - -/** - * An enumeration of the possible names of a standoff tag submitted as a JSON `textattr`. Note: do not use the `withName` method to get instances - * of the values of this enumeration; use `lookup` instead, because it reports errors better. - */ -object LegacyTextattrV1 extends Enumeration { - - // internal name / standoff tag name in JSON representation / corresponding HTML tag (generated by the GUI) - val paragraph: LegacyTextattrV1.Value = Value("p") - //

...

- val italic: LegacyTextattrV1.Value = Value("italic") - // ... - val bold: LegacyTextattrV1.Value = Value("bold") - // ... - val underline: LegacyTextattrV1.Value = Value("underline") - // ... - val strikethrough: LegacyTextattrV1.Value = Value("strikethrough") - // ... - val link: LegacyTextattrV1.Value = Value("_link") - // ... - val header1: LegacyTextattrV1.Value = Value("h1") - //

...

- val header2: LegacyTextattrV1.Value = Value("h2") - //

...

- val header3: LegacyTextattrV1.Value = Value("h3") - //

...

- val header4: LegacyTextattrV1.Value = Value("h4") - //

...

- val header5: LegacyTextattrV1.Value = Value("h5") - //
...
- val header6: LegacyTextattrV1.Value = Value("h6") - //
...
- val superscript: LegacyTextattrV1.Value = Value("sup") - // ... - val subscript: LegacyTextattrV1.Value = Value("sub") - // ... - val orderedList: LegacyTextattrV1.Value = Value("ol") - //
    ...
- val unorderedList: LegacyTextattrV1.Value = Value("ul") - //
    ...
- val listElement: LegacyTextattrV1.Value = Value("li") - //
  • ...
  • - val styleElement: LegacyTextattrV1.Value = Value("style") // ... - - val valueMap: Map[String, Value] = values.map(v => (v.toString, v)).toMap - - /** - * Given the name of a value in this enumeration, returns the value. If the value is not found, the provided error function is called. - * - * @param name the name of the value. - * @param errorFun the function to be called in case of an error. - * @return the requested value. - */ - def lookup(name: String, errorFun: => Nothing): Value = { - valueMap.get(name) match { - case Some(value) => value - case None => errorFun - } - } - - /** - * Maps standoff tag IRIs to this enumeration's values. - */ - val iriToEnumValue: Map[IRI, LegacyTextattrV1.Value] = new ErrorHandlingMap(Map( - OntologyConstants.Standoff.StandoffParagraphTag -> paragraph, - OntologyConstants.Standoff.StandoffItalicTag -> italic, - OntologyConstants.Standoff.StandoffBoldTag -> bold, - OntologyConstants.Standoff.StandoffUnderlineTag -> underline, - OntologyConstants.Standoff.StandoffStrikethroughTag -> strikethrough, - OntologyConstants.KnoraBase.StandoffLinkTag -> link, - OntologyConstants.KnoraBase.StandoffUriTag -> link, - OntologyConstants.Standoff.StandoffHeader1Tag -> header1, - OntologyConstants.Standoff.StandoffHeader2Tag -> header2, - OntologyConstants.Standoff.StandoffHeader3Tag -> header3, - OntologyConstants.Standoff.StandoffHeader4Tag -> header4, - OntologyConstants.Standoff.StandoffHeader5Tag -> header5, - OntologyConstants.Standoff.StandoffHeader6Tag -> header6, - OntologyConstants.Standoff.StandoffSuperscriptTag -> superscript, - OntologyConstants.Standoff.StandoffSubscriptTag -> subscript, - OntologyConstants.Standoff.StandoffOrderedListTag -> orderedList, - OntologyConstants.Standoff.StandoffUnorderedListTag -> unorderedList, - OntologyConstants.Standoff.StandoffListElementTag -> listElement, - OntologyConstants.Standoff.StandoffStyleElementTag -> styleElement - ), { key => throw InconsistentTriplestoreDataException(s"Invalid standoff tag IRI: $key") }) - - - // Maps this enumeration's values to standoff tag IRIs. - - val enumValueToIri: Map[LegacyTextattrV1.Value, IRI] = new ErrorHandlingMap(iriToEnumValue.map(_.swap), { key => throw InconsistentTriplestoreDataException(s"Invalid standoff tag name: $key") }) -} - -/** - * Updates the structure of Knora repository data to accommodate changes in Knora. - */ -object TransformData extends App { - - private val log = Logger(LoggerFactory.getLogger(this.getClass)) - - private val IsDeletedTransformationOption = "deleted" - private val PermissionsTransformationOption = "permissions" - private val JulianDayTransformation = "jdn" - // jdn must be run before strings - private val MissingValueHasStringTransformationOption = "strings" - private val RegionLabelTransformation = "regionlabels" - private val ValueProjectTransformationOption = "valueproject" - private val PreviewTransformationOption = "preview" - private val AllTransformationsOption = "all" - - private val allTransformations = Vector( - JulianDayTransformation, - IsDeletedTransformationOption, - PermissionsTransformationOption, - MissingValueHasStringTransformationOption, - RegionLabelTransformation, - ValueProjectTransformationOption, - PreviewTransformationOption - ) - - private val TempFilePrefix = "TransformData" - private val TempFileSuffix = ".ttl" - - private val HasRestrictedViewPermission = "http://www.knora.org/ontology/knora-base#hasRestrictedViewPermission" - private val HasViewPermission = "http://www.knora.org/ontology/knora-base#hasViewPermission" - private val HasModifyPermission = "http://www.knora.org/ontology/knora-base#hasModifyPermission" - private val HasDeletePermission = "http://www.knora.org/ontology/knora-base#hasDeletePermission" - private val HasChangeRightsPermission = "http://www.knora.org/ontology/knora-base#hasChangeRightsPermission" - private val HasChangeRightsPermisson = "http://www.knora.org/ontology/knora-base#hasChangeRightsPermisson" // This misspelling occurs in some old test data - - private val allOldPermissions = Set( - HasRestrictedViewPermission, - HasViewPermission, - HasModifyPermission, - HasDeletePermission, - HasChangeRightsPermission, - HasChangeRightsPermisson - ) - - private val oldPermissionIri2EntityPermission: Map[IRI, EntityPermission] = Map( - HasRestrictedViewPermission -> PermissionUtilADM.RestrictedViewPermission, - HasViewPermission -> PermissionUtilADM.ViewPermission, - HasModifyPermission -> PermissionUtilADM.ModifyPermission, - HasDeletePermission -> PermissionUtilADM.DeletePermission, - HasChangeRightsPermission -> PermissionUtilADM.ChangeRightsPermission, - HasChangeRightsPermisson -> PermissionUtilADM.ChangeRightsPermission - ) - - private val StandardClassesWithoutIsDeleted = Set( - OntologyConstants.KnoraAdmin.User, - OntologyConstants.KnoraAdmin.UserGroup, - OntologyConstants.KnoraAdmin.KnoraProject, - OntologyConstants.KnoraAdmin.Institution, - OntologyConstants.KnoraBase.ListNode - ) - - private val ValueHasStartJDC = "http://www.knora.org/ontology/knora-base#valueHasStartJDC" - private val ValueHasEndJDC = "http://www.knora.org/ontology/knora-base#valueHasEndJDC" - - // A Map of old standoff class IRIs to new ones - private val standoffClassMap = Map( - "http://www.knora.org/ontology/knora-base#StandoffRootTag" -> OntologyConstants.Standoff.StandoffRootTag, - "http://www.knora.org/ontology/knora-base#StandoffParagraphTag" -> OntologyConstants.Standoff.StandoffParagraphTag, - "http://www.knora.org/ontology/knora-base#StandoffItalicTag" -> OntologyConstants.Standoff.StandoffItalicTag, - "http://www.knora.org/ontology/knora-base#StandoffBoldTag" -> OntologyConstants.Standoff.StandoffBoldTag, - "http://www.knora.org/ontology/knora-base#StandoffUnderlineTag" -> OntologyConstants.Standoff.StandoffUnderlineTag, - "http://www.knora.org/ontology/knora-base#StandoffStrikethroughTag" -> OntologyConstants.Standoff.StandoffStrikethroughTag, - "http://www.knora.org/ontology/knora-base#StandoffHeader1Tag" -> OntologyConstants.Standoff.StandoffHeader1Tag, - "http://www.knora.org/ontology/knora-base#StandoffHeader2Tag" -> OntologyConstants.Standoff.StandoffHeader2Tag, - "http://www.knora.org/ontology/knora-base#StandoffHeader3Tag" -> OntologyConstants.Standoff.StandoffHeader3Tag, - "http://www.knora.org/ontology/knora-base#StandoffHeader4Tag" -> OntologyConstants.Standoff.StandoffHeader4Tag, - "http://www.knora.org/ontology/knora-base#StandoffHeader5Tag" -> OntologyConstants.Standoff.StandoffHeader5Tag, - "http://www.knora.org/ontology/knora-base#StandoffHeader6Tag" -> OntologyConstants.Standoff.StandoffHeader6Tag, - "http://www.knora.org/ontology/knora-base#StandoffSuperscriptTag" -> OntologyConstants.Standoff.StandoffSuperscriptTag, - "http://www.knora.org/ontology/knora-base#StandoffSubscriptTag" -> OntologyConstants.Standoff.StandoffSubscriptTag, - "http://www.knora.org/ontology/knora-base#StandoffOrderedListTag" -> OntologyConstants.Standoff.StandoffOrderedListTag, - "http://www.knora.org/ontology/knora-base#StandoffUnorderedListTag" -> OntologyConstants.Standoff.StandoffUnorderedListTag, - "http://www.knora.org/ontology/knora-base#StandoffListElementTag" -> OntologyConstants.Standoff.StandoffListElementTag, - "http://www.knora.org/ontology/knora-base#StandoffStyleTag" -> OntologyConstants.Standoff.StandoffStyleElementTag - ) - - private val conf = new TransformDataConf(args) - private val transformationOption = conf.transform() - private val inputFile = new File(conf.input()) - private val outputFile = new File(conf.output()) - - if (transformationOption == AllTransformationsOption) { - runAllTransformations(inputFile, outputFile) - } else { - runTransformation(transformationOption, inputFile, outputFile) - } - - /** - * Runs all transformations, using temporary files as needed. - * - * @param inputFile the input file. - * @param outputFile the output file. - */ - private def runAllTransformations(inputFile: File, outputFile: File): Unit = { - /** - * Associates a transformation with an input file and and output file, either of which may be a temporary file. - * - * @param transformation the name of the transformation. - * @param inputFileForTrans the input file to be used for the transformation. - * @param outputFileForTrans the output file to be used for the transformation. - */ - case class TransformationWithFiles(transformation: String, inputFileForTrans: File, outputFileForTrans: File) - - // Make a list of transformations to be run, with an input file and an output file for each one, generating - // temporary file names as needed. - val transformationsWithFiles: Vector[TransformationWithFiles] = allTransformations.foldLeft(Vector.empty[TransformationWithFiles]) { - case (acc, trans) => - // Is this is the first transformation? - val inputFileForTrans = if (trans == allTransformations.head) { - // Yes. Use the user's input file as the input file for the transformation. - inputFile - } else { - // No. Use the previous transformation's output file as the input file for this transformation. - acc.last.outputFileForTrans - } - - // Is this the last transformation? - val outputFileForTrans = if (trans == allTransformations.last) { - // Yes. Use the user's output file as the output file for the transformation. - outputFile - } else { - // No. Use a temporary file. - File.createTempFile(TempFilePrefix, TempFileSuffix) - } - - acc :+ TransformationWithFiles( - transformation = trans, - inputFileForTrans = inputFileForTrans, - outputFileForTrans = outputFileForTrans - ) - } - - // Run all the transformations. - for (transformationWithFiles <- transformationsWithFiles) { - runTransformation( - transformation = transformationWithFiles.transformation, - inputFile = transformationWithFiles.inputFileForTrans, - outputFile = transformationWithFiles.outputFileForTrans - ) - } - } - - /** - * Runs the specified transformation. - * - * @param transformation the name of the transformation to be run. - * @param inputFile the input file. - * @param outputFile the output file. - */ - private def runTransformation(transformation: String, inputFile: File, outputFile: File): Unit = { - // println(s"Running transformation $transformation with inputFile $inputFile and outputFile $outputFile") - - val fileInputStream = new FileInputStream(inputFile) - val fileOutputStream = new FileOutputStream(outputFile) - val turtleParser = new TurtleParser() - val turtleWriter = new TurtleWriter(fileOutputStream) - - val handler = transformation match { - case IsDeletedTransformationOption => new IsDeletedHandler(turtleWriter) - case PermissionsTransformationOption => new PermissionsHandler(turtleWriter) - case MissingValueHasStringTransformationOption => new ValueHasStringHandler(turtleWriter) - case RegionLabelTransformation => new RegionLabelHandler(turtleWriter) - case JulianDayTransformation => new JDNHandler(turtleWriter) - case ValueProjectTransformationOption => new ValueProjectHandler(turtleWriter) - case PreviewTransformationOption => new PreviewHandler(turtleWriter) - case _ => throw new Exception(s"Unsupported transformation $transformation") - } - - turtleParser.setRDFHandler(handler) - turtleParser.parse(fileInputStream, inputFile.getAbsolutePath) - fileOutputStream.close() - fileInputStream.close() - } - - private class PreviewHandler(turtleWriter: RDFWriter) extends StatementCollectingHandler(turtleWriter: RDFWriter) { - private val IsPreview: IRI = KnoraBasePrefixExpansion + "isPreview" - private val QualityLevel: IRI = KnoraBasePrefixExpansion + "qualityLevel" - private val ValueHasQname: IRI = KnoraBasePrefixExpansion + "valueHasQname" - private val obsoletePredicates = Set(IsPreview, QualityLevel, ValueHasQname) - - override def endRDF(): Unit = { - val previewImageIris: Set[IRI] = statements.foldLeft(Set.empty[IRI]) { - case (acc, (subject, subjectStatements: Vector[Statement])) => - if (subjectStatements.exists(statement => statement.getPredicate.stringValue == IsPreview && statement.getObject.stringValue.toBoolean)) { - acc + subject.stringValue - } else { - acc - } - } - - statements.foreach { - case (subject, subjectStatements: Vector[Statement]) => - if (!previewImageIris.contains(subject.stringValue)) { - subjectStatements.foreach { - statement => - if (!(previewImageIris.contains(statement.getObject.stringValue) || - obsoletePredicates.contains(statement.getPredicate.stringValue))) { - turtleWriter.handleStatement(statement) - } - } - } - } - - turtleWriter.endRDF() - } - } - - /** - * Looks for regions that have the label "test" and changes their label to the value of their `knora-base:hasComment`. - * - * @param turtleWriter an [[RDFWriter]] that writes to the output file. - */ - private class RegionLabelHandler(turtleWriter: RDFWriter) extends StatementCollectingHandler(turtleWriter: RDFWriter) { - override def endRDF(): Unit = { - statements.foreach { - case (_, subjectStatements: Vector[Statement]) => - val subjectType = subjectStatements.find(_.getPredicate.stringValue == OntologyConstants.Rdf.Type).get.getObject.stringValue - val label = subjectStatements.find(_.getPredicate.stringValue == OntologyConstants.Rdfs.Label).map(_.getObject.stringValue) - - val newLabel = if (subjectType == OntologyConstants.KnoraBase.Region && (label.isEmpty || label.contains("test"))) { - val commentIri = subjectStatements.find(_.getPredicate.stringValue == OntologyConstants.KnoraBase.HasComment).get.getObject.stringValue - Some(statements(valueFactory.createIRI(commentIri)).find(_.getPredicate.stringValue == OntologyConstants.KnoraBase.ValueHasString).get.getObject.stringValue) - } else { - label - } - - subjectStatements.foreach { - statement => - val newStatement = if (statement.getPredicate.stringValue == OntologyConstants.Rdfs.Label) { - valueFactory.createStatement( - statement.getSubject, - statement.getPredicate, - valueFactory.createLiteral(newLabel.get) - ) - } else { - statement - } - - turtleWriter.handleStatement(newStatement) - } - - } - - turtleWriter.endRDF() - } - } - - /** - * Adds `knora-base:isDeleted false` to resources and values that don't have a `knora-base:isDeleted` predicate. - * - * @param turtleWriter an [[RDFWriter]] that writes to the output file. - */ - private class IsDeletedHandler(turtleWriter: RDFWriter) extends StatementCollectingHandler(turtleWriter: RDFWriter) { - override def endRDF(): Unit = { - statements.foreach { - case (_, subjectStatements: Vector[Statement]) => - // Check whether the subject already has a knora-base:isDeleted predicate. - val hasIsDeleted = subjectStatements.exists(_.getPredicate.stringValue == OntologyConstants.KnoraBase.IsDeleted) - val isStandoff = subjectStatements.exists(_.getPredicate.stringValue == OntologyConstants.KnoraBase.StandoffTagHasStart) - - subjectStatements.foreach { - statement => - turtleWriter.handleStatement(statement) - - // If this statement provides the rdf:type of the subject, and the subject doesn't have a - // knora-base:isDeleted predicate, check whether it needs one. - if (statement.getPredicate.stringValue == OntologyConstants.Rdf.Type && !hasIsDeleted) { - val rdfType = statement.getObject.stringValue - - // If the rdf:type isn't one of the standard classes that can't be marked as deleted, - // and the subject isn't a standoff tag, assume it must be a Resource or Value, - // and add knora-base:isDeleted false. - if (!(StandardClassesWithoutIsDeleted.contains(rdfType) || isStandoff)) { - val isDeletedStatement = valueFactory.createStatement( - statement.getSubject, - valueFactory.createIRI(OntologyConstants.KnoraBase.IsDeleted), - valueFactory.createLiteral(false) - ) - - turtleWriter.handleStatement(isDeletedStatement) - } - } - } - } - - turtleWriter.endRDF() - } - } - - /** - * Transforms old-style Knora permissions statements into new-style permissions statements. - * - * @param turtleWriter an [[RDFWriter]] that writes to the output file. - */ - private class PermissionsHandler(turtleWriter: RDFWriter) extends StatementCollectingHandler(turtleWriter: RDFWriter) { - override def endRDF(): Unit = { - statements.foreach { - case (subject: Resource, subjectStatements: Vector[Statement]) => - // Write the statements about each resource. - val subjectPermissions = subjectStatements.foldLeft(Map.empty[EntityPermission, Set[IRI]]) { - case (acc, st) => - val predicateStr = st.getPredicate.stringValue - - // If a statement describes an old-style permission, save it. - if (allOldPermissions.contains(predicateStr)) { - val group = st.getObject.stringValue() - val accessPermission = oldPermissionIri2EntityPermission(predicateStr) - val currentGroupsForPermission = acc.getOrElse(accessPermission, Set.empty[IRI]) - acc + (accessPermission -> (currentGroupsForPermission + group)) - } else { - // Otherwise, write it. - turtleWriter.handleStatement(st) - acc - } - } - - // Write the resource's permissions as a single statement. - if (subjectPermissions.nonEmpty) { - val permissionADMs: Set[PermissionADM] = subjectPermissions.toVector.flatMap { - case (accessPermission, groups) => groups.map { - group => - PermissionADM( - name = accessPermission.toString, - additionalInformation = Some(group), - permissionCode = Some(accessPermission.toInt) - ) - } - }.toSet - - val permissionLiteral = PermissionUtilADM.formatPermissionADMs(permissionADMs, PermissionType.OAP) - - val permissionStatement = valueFactory.createStatement( - subject, - valueFactory.createIRI(OntologyConstants.KnoraBase.HasPermissions), - valueFactory.createLiteral(permissionLiteral) - ) - - turtleWriter.handleStatement(permissionStatement) - } - } - - turtleWriter.endRDF() - } - } - - /** - * Adds missing `knora-base:valueHasString` statements. - * - * @param turtleWriter an [[RDFWriter]] that writes to the output file. - */ - private class ValueHasStringHandler(turtleWriter: RDFWriter) extends StatementCollectingHandler(turtleWriter: RDFWriter) { - - private def maybeWriteValueHasString(subject: Resource, subjectStatements: Vector[Statement]): Unit = { - val resourceClass = getObject(subjectStatements, OntologyConstants.Rdf.Type).get - - // Is this Knora value object? - if (resourceClass.startsWith(OntologyConstants.KnoraBase.KnoraBasePrefixExpansion) && resourceClass.endsWith("Value")) { - // Yes. Does it already have a valueHasString? - val maybeValueHasStringStatement: Option[Statement] = subjectStatements.find(_.getPredicate.stringValue == OntologyConstants.KnoraBase.ValueHasString) - - if (maybeValueHasStringStatement.isEmpty) { - // No. Generate one. - - val stringLiteral = resourceClass match { - case OntologyConstants.KnoraBase.IntValue => getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasInteger).get - case OntologyConstants.KnoraBase.BooleanValue => getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasBoolean).get - case OntologyConstants.KnoraBase.UriValue => getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasUri).get - case OntologyConstants.KnoraBase.DecimalValue => getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasDecimal).get - - case OntologyConstants.KnoraBase.DateValue => - val startJDN = getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasStartJDN).get - val endJDN = getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasEndJDN).get - val startPrecision = getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasStartPrecision).get - val endPrecision = getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasEndPrecision).get - val calendar = getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasCalendar).get - - val jdnValue = JulianDayNumberValueV1( - dateval1 = startJDN.toInt, - dateval2 = endJDN.toInt, - calendar = KnoraCalendarV1.lookup(calendar), - dateprecision1 = KnoraPrecisionV1.lookup(startPrecision), - dateprecision2 = KnoraPrecisionV1.lookup(endPrecision) - ) - - jdnValue.toString - - case OntologyConstants.KnoraBase.ColorValue => getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasColor).get - case OntologyConstants.KnoraBase.GeomValue => getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasGeometry).get - case OntologyConstants.KnoraBase.StillImageFileValue => getObject(subjectStatements, OntologyConstants.KnoraBase.OriginalFilename).get - case OntologyConstants.KnoraBase.ListValue => getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasListNode).get - - case OntologyConstants.KnoraBase.IntervalValue => - val intervalStart = getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasIntervalStart).get - val intervalEnd = getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasIntervalEnd).get - - val intervalValue = IntervalValueV1( - timeval1 = BigDecimal(intervalStart), - timeval2 = BigDecimal(intervalEnd) - ) - - intervalValue.toString - - case OntologyConstants.KnoraBase.GeonameValue => getObject(subjectStatements, OntologyConstants.KnoraBase.ValueHasGeonameCode).get - case OntologyConstants.KnoraBase.LinkValue => getObject(subjectStatements, OntologyConstants.Rdf.Object).get - - case _ => throw InconsistentTriplestoreDataException(s"Unsupported value type $resourceClass") - } - - val valueHasStringStatement = valueFactory.createStatement( - subject, - valueFactory.createIRI(OntologyConstants.KnoraBase.ValueHasString), - valueFactory.createLiteral(stringLiteral) - ) - - turtleWriter.handleStatement(valueHasStringStatement) - } - } - } - - override def endRDF(): Unit = { - statements.foreach { - case (subject: Resource, subjectStatements: Vector[Statement]) => - subjectStatements.foreach(st => turtleWriter.handleStatement(st)) - maybeWriteValueHasString(subject, subjectStatements) - } - - turtleWriter.endRDF() - } - } - - /** - * Replaces `knora-base:valueHasStartJDC` with `knora-base:valueHasStartJDN` and `knora-base:valueHasEndJDC` - * with `knora-base:valueHasEndJDN`. - * - * @param turtleWriter an [[RDFWriter]] that writes to the output file. - */ - private class JDNHandler(turtleWriter: RDFWriter) extends RDFHandler { - private val valueFactory = SimpleValueFactory.getInstance() - - override def handleComment(comment: IRI): Unit = { - turtleWriter.handleComment(comment) - } - - override def handleStatement(st: Statement): Unit = { - val newPredicate = st.getPredicate.stringValue match { - case ValueHasStartJDC => valueFactory.createIRI(OntologyConstants.KnoraBase.ValueHasStartJDN) - case ValueHasEndJDC => valueFactory.createIRI(OntologyConstants.KnoraBase.ValueHasEndJDN) - case _ => st.getPredicate - } - - turtleWriter.handleStatement(valueFactory.createStatement( - st.getSubject, - newPredicate, - st.getObject - )) - } - - override def endRDF(): Unit = { - turtleWriter.endRDF() - } - - override def handleNamespace(prefix: IRI, uri: IRI): Unit = { - turtleWriter.handleNamespace(prefix, uri) - } - - override def startRDF(): Unit = { - turtleWriter.startRDF() - } - } - - /** - * Removes `knora-base:attachedToProject` from Knora values. - * - * @param turtleWriter an [[RDFWriter]] that writes to the output file. - */ - private class ValueProjectHandler(turtleWriter: RDFWriter) extends StatementCollectingHandler(turtleWriter: RDFWriter) { - override def endRDF(): Unit = { - statements.foreach { - case (subject: Resource, subjectStatements: Vector[Statement]) => - val rdfType = getObject(subjectStatements = subjectStatements, predicateIri = OntologyConstants.Rdf.Type).getOrElse(s"Subject $subject has no rdf:type") - - val statementsToWrite = if (OntologyConstants.KnoraBase.ValueClasses.contains(rdfType)) { - subjectStatements.filter(_.getPredicate.stringValue != OntologyConstants.KnoraBase.AttachedToProject) - } else { - subjectStatements - } - - statementsToWrite.foreach { - statement => turtleWriter.handleStatement(statement) - } - } - - turtleWriter.endRDF() - } - } - - - /** - * Parses command-line arguments. - */ - private class TransformDataConf(arguments: Seq[String]) extends ScallopConf(arguments) { - banner( - s""" - |Updates the structure of Knora repository data to accommodate changes in Knora. - | - |Usage: org.knora.webapi.util.TransformData -t [$IsDeletedTransformationOption|$PermissionsTransformationOption|$MissingValueHasStringTransformationOption|$RegionLabelTransformation|$JulianDayTransformation|$ValueProjectTransformationOption|$PreviewTransformationOption|$AllTransformationsOption] input output - """.stripMargin) - - val transform: ScallopOption[String] = opt[String]( - required = true, - validate = t => Set(IsDeletedTransformationOption, PermissionsTransformationOption, MissingValueHasStringTransformationOption, RegionLabelTransformation, JulianDayTransformation, ValueProjectTransformationOption, PreviewTransformationOption, AllTransformationsOption).contains(t), - descr = s"Selects a transformation. Available transformations: '$IsDeletedTransformationOption' (adds missing 'knora-base:isDeleted' statements), '$PermissionsTransformationOption' (combines old-style multiple permission statements into single permission statements), '$MissingValueHasStringTransformationOption' (adds missing valueHasString), '$RegionLabelTransformation' (fixes the labels of regions whose label is 'test'), '$JulianDayTransformation' (changes Julian Day Count to Julian Day Number), '$ValueProjectTransformationOption' (removes 'knora-base:attachedToProject' from values), '$PreviewTransformationOption' (removes preview images), '$AllTransformationsOption'" - ) - - val input: ScallopOption[String] = trailArg[String](required = true, descr = "Input Turtle file") - val output: ScallopOption[String] = trailArg[String](required = true, descr = "Output Turtle file") - verify() - } - -} diff --git a/webapi/src/main/scala/org/knora/webapi/util/TransformOntology.scala b/webapi/src/main/scala/org/knora/webapi/util/TransformOntology.scala deleted file mode 100644 index 28e350a899..0000000000 --- a/webapi/src/main/scala/org/knora/webapi/util/TransformOntology.scala +++ /dev/null @@ -1,215 +0,0 @@ -package org.knora.webapi.util - -import java.io._ - -import com.typesafe.scalalogging.Logger -import org.eclipse.rdf4j.model.{Resource, Statement} -import org.eclipse.rdf4j.rio.RDFWriter -import org.eclipse.rdf4j.rio.helpers.BasicWriterSettings -import org.eclipse.rdf4j.rio.turtle._ -import org.knora.webapi.OntologyConstants -import org.rogach.scallop._ -import org.slf4j.LoggerFactory - -import scala.collection.immutable.TreeMap - -/** - * Updates the structure of an ontology to accommodate changes in Knora. - */ -object TransformOntology extends App { - private val log = Logger(LoggerFactory.getLogger(this.getClass)) - - private val TempFilePrefix = "TransformOntology" - private val TempFileSuffix = ".ttl" - - private val GuiOrderTransformationOption = "guiorder" - private val AllTransformationsOption = "all" - - private val allTransformations = Vector( - GuiOrderTransformationOption - ) - - private val conf = new TransformOntologyConf(args) - private val transformationOption = conf.transform() - private val inputFile = new File(conf.input()) - private val outputFile = new File(conf.output()) - - if (transformationOption == AllTransformationsOption) { - runAllTransformations(inputFile, outputFile) - } else { - runTransformation(transformationOption, inputFile, outputFile) - } - - /** - * Runs all transformations, using temporary files as needed. - * - * @param inputFile the input file. - * @param outputFile the output file. - */ - private def runAllTransformations(inputFile: File, outputFile: File): Unit = { - /** - * Associates a transformation with an input file and and output file, either of which may be a temporary file. - * - * @param transformation the name of the transformation. - * @param inputFileForTrans the input file to be used for the transformation. - * @param outputFileForTrans the output file to be used for the transformation. - */ - case class TransformationWithFiles(transformation: String, inputFileForTrans: File, outputFileForTrans: File) - - // Make a list of transformations to be run, with an input file and an output file for each one, generating - // temporary file names as needed. - val transformationsWithFiles: Vector[TransformationWithFiles] = allTransformations.foldLeft(Vector.empty[TransformationWithFiles]) { - case (acc, trans) => - // Is this is the first transformation? - val inputFileForTrans = if (trans == allTransformations.head) { - // Yes. Use the user's input file as the input file for the transformation. - inputFile - } else { - // No. Use the previous transformation's output file as the input file for this transformation. - acc.last.outputFileForTrans - } - - // Is this the last transformation? - val outputFileForTrans = if (trans == allTransformations.last) { - // Yes. Use the user's output file as the output file for the transformation. - outputFile - } else { - // No. Use a temporary file. - File.createTempFile(TempFilePrefix, TempFileSuffix) - } - - acc :+ TransformationWithFiles( - transformation = trans, - inputFileForTrans = inputFileForTrans, - outputFileForTrans = outputFileForTrans - ) - } - - // Run all the transformations. - for (transformationWithFiles <- transformationsWithFiles) { - runTransformation( - transformation = transformationWithFiles.transformation, - inputFile = transformationWithFiles.inputFileForTrans, - outputFile = transformationWithFiles.outputFileForTrans - ) - } - } - - /** - * Runs the specified transformation. - * - * @param transformation the name of the transformation to be run. - * @param inputFile the input file. - * @param outputFile the output file. - */ - private def runTransformation(transformation: String, inputFile: File, outputFile: File): Unit = { - // println(s"Running transformation $transformation with inputFile $inputFile and outputFile $outputFile") - - val fileInputStream = new FileInputStream(inputFile) - val fileOutputStream = new FileOutputStream(outputFile) - val turtleParser = new TurtleParser() - val turtleWriter = new TurtleWriterFactory().getWriter(fileOutputStream) - turtleWriter.getWriterConfig.set[java.lang.Boolean](BasicWriterSettings.PRETTY_PRINT, true).set[java.lang.Boolean](BasicWriterSettings.INLINE_BLANK_NODES, true) - - val handler = transformation match { - case GuiOrderTransformationOption => new GuiOrderHandler(turtleWriter) - - case _ => throw new Exception(s"Unsupported transformation $transformation") - } - - turtleParser.setRDFHandler(handler) - turtleParser.parse(fileInputStream, inputFile.getAbsolutePath) - fileOutputStream.close() - fileInputStream.close() - } - - /** - * Moves `salsah-gui:guiOrder` from property definitions into cardinalities. - * - * @param turtleWriter an [[RDFWriter]] that writes to the output file. - */ - private class GuiOrderHandler(turtleWriter: RDFWriter) extends StatementCollectingHandler(turtleWriter: RDFWriter) { - override def endRDF(): Unit = { - var guiOrders: TreeMap[Resource, Int] = TreeMap.empty[Resource, Int] - var statementsWithoutGuiOrders: TreeMap[Resource, Vector[Statement]] = TreeMap.empty[Resource, Vector[Statement]] - - statements.foreach { - case (subject: Resource, subjectStatements: Vector[Statement]) => - val subjectType = subjectStatements.find(_.getPredicate.stringValue == OntologyConstants.Rdf.Type).get.getObject.stringValue - - if (subjectType == OntologyConstants.Owl.ObjectProperty) { - val maybeGuiOrderStatement = subjectStatements.find(_.getPredicate.stringValue == OntologyConstants.SalsahGui.GuiOrder) - - maybeGuiOrderStatement match { - case Some(guiOrderStatement: Statement) => - val guiOrder = guiOrderStatement.getObject.stringValue.toInt - guiOrders += (subject -> guiOrder) - val subjectStatementsWithoutGuiOrders = subjectStatements.filterNot(_.getPredicate.stringValue == OntologyConstants.SalsahGui.GuiOrder) - statementsWithoutGuiOrders += (subject -> subjectStatementsWithoutGuiOrders) - - case None => - statementsWithoutGuiOrders += (subject -> subjectStatements) - } - } else { - statementsWithoutGuiOrders += (subject -> subjectStatements) - } - } - - statementsWithoutGuiOrders.foreach { - case (subject: Resource, subjectStatements: Vector[Statement]) => - val subjectType = subjectStatements.find(_.getPredicate.stringValue == OntologyConstants.Rdf.Type).get.getObject.stringValue - - val outputStatements = if (subjectType == OntologyConstants.Owl.Restriction) { - val onProperty = valueFactory.createIRI(subjectStatements.find(_.getPredicate.stringValue == OntologyConstants.Owl.OnProperty).get.getObject.stringValue) - - guiOrders.get(onProperty) match { - case Some(guiOrder) => - val guiOrderStatement = valueFactory.createStatement( - subject, - valueFactory.createIRI(OntologyConstants.SalsahGui.GuiOrder), - valueFactory.createLiteral(guiOrder) - ) - - subjectStatements :+ guiOrderStatement - - case None => - subjectStatements - } - } else { - subjectStatements - } - - for (statement <- outputStatements) { - turtleWriter.handleStatement(statement) - } - } - - turtleWriter.endRDF() - } - } - - /** - * Parses command-line arguments. - */ - private class TransformOntologyConf(arguments: Seq[String]) extends ScallopConf(arguments) { - banner( - s""" - |Updates the structure of a Knora ontology to accommodate changes in Knora. - | - |Usage: org.knora.webapi.util.TransformOntology -t [$GuiOrderTransformationOption|$AllTransformationsOption] input output - """.stripMargin) - - val transform: ScallopOption[String] = opt[String]( - required = true, - validate = { - t => Set(GuiOrderTransformationOption, AllTransformationsOption).contains(t) - }, - descr = s"Selects a transformation. Available transformations: '$GuiOrderTransformationOption' (moves 'salsah-gui:guiOrder' from properties to cardinalities), '$AllTransformationsOption' (all of the above)" - ) - - val input: ScallopOption[String] = trailArg[String](required = true, descr = "Input Turtle file") - val output: ScallopOption[String] = trailArg[String](required = true, descr = "Output Turtle file") - verify() - } - -} diff --git a/webapi/src/main/scala/org/knora/webapi/util/jsonld/JsonLDUtil.scala b/webapi/src/main/scala/org/knora/webapi/util/jsonld/JsonLDUtil.scala index e373ab3d79..982d4d96fc 100644 --- a/webapi/src/main/scala/org/knora/webapi/util/jsonld/JsonLDUtil.scala +++ b/webapi/src/main/scala/org/knora/webapi/util/jsonld/JsonLDUtil.scala @@ -810,7 +810,7 @@ object JsonLDUtil { val context: java.util.HashMap[String, Any] = new java.util.HashMap[String, Any]() val options: JsonLdOptions = new JsonLdOptions() val compact: java.util.Map[IRI, AnyRef] = JsonLdProcessor.compact(jsonObject, context, options) - val scalaColl: Any = JavaUtil.deepJavatoScala(compact) + val scalaColl: Any = JavaUtil.deepJavaToScala(compact) val scalaMap: Map[String, Any] = try { scalaColl.asInstanceOf[Map[String, Any]] diff --git a/webapi/src/test/resources/logback-test.xml b/webapi/src/test/resources/logback-test.xml index 5b3b8c8013..8fdc8a26d9 100644 --- a/webapi/src/test/resources/logback-test.xml +++ b/webapi/src/test/resources/logback-test.xml @@ -59,7 +59,7 @@ - + diff --git a/webapi/src/test/resources/test-data/update/pr1307.trig b/webapi/src/test/resources/test-data/update/pr1307.trig new file mode 100644 index 0000000000..a260d149ac --- /dev/null +++ b/webapi/src/test/resources/test-data/update/pr1307.trig @@ -0,0 +1,100 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix owl: . +@prefix knora-base: . +@prefix knora-admin: . +@prefix standoff: . +@prefix anything: . + + { + a anything:Thing; + rdfs:label "Something with a lot of markup"; + knora-base:isDeleted false; + knora-base:attachedToProject ; + knora-base:creationDate "2018-05-30T13:44:11.749Z"^^xsd:dateTime; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:KnownUser|RV knora-admin:UnknownUser"; + knora-base:attachedToUser ; + anything:hasRichtext . + + a knora-base:TextValue; + knora-base:isDeleted false; + knora-base:valueHasStandoff , + , + , + , + , + , + , + ; + knora-base:valueHasMapping ; + knora-base:valueCreationDate "2018-05-30T13:44:11.749Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "Something with a lot of different markup. And more markup."; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:KnownUser|RV knora-admin:UnknownUser"; + knora-base:attachedToUser . + + + a standoff:StandoffBoldTag; + knora-base:standoffTagHasStart 0; + knora-base:standoffTagHasEnd 9; + knora-base:standoffTagHasStartIndex 2; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "7f3af890-c77d-4bf8-a81c-6786632520dd" . + + + a standoff:StandoffSuperscriptTag; + knora-base:standoffTagHasStart 34; + knora-base:standoffTagHasEnd 40; + knora-base:standoffTagHasStartIndex 6; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "e2ab65d2-6c80-494e-88ba-66767ed885f9" . + + + a standoff:StandoffParagraphTag; + knora-base:standoffTagHasStart 0; + knora-base:standoffTagHasEnd 58; + knora-base:standoffTagHasStartIndex 1; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "f3c0773a-2eb3-4d2e-9a6f-c8f2582a146e" . + + + a knora-base:StandoffUriTag; + knora-base:standoffTagHasStart 51; + knora-base:standoffTagHasEnd 57; + knora-base:standoffTagHasStartIndex 7; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "7b9f4609-3ba6-43e5-b945-d4329a155ca7"; + knora-base:valueHasUri "http://www.google.ch"^^xsd:anyURI . + + + a standoff:StandoffUnderlineTag; + knora-base:standoffTagHasStart 24; + knora-base:standoffTagHasEnd 33; + knora-base:standoffTagHasStartIndex 5; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "df348cfa-c362-45e6-9e13-601442214064" . + + + a standoff:StandoffRootTag; + knora-base:standoffTagHasStart 0; + knora-base:standoffTagHasEnd 59; + knora-base:standoffTagHasStartIndex 0; + knora-base:standoffTagHasUUID "c41e4e78-8b4f-47fc-9d17-8af0a279c80c" . + + + a standoff:StandoffItalicTag; + knora-base:standoffTagHasStart 10; + knora-base:standoffTagHasEnd 14; + knora-base:standoffTagHasStartIndex 3; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "13f66d42-2b1f-4fb4-91aa-6c55e350b0f4" . + + + a standoff:StandoffStrikethroughTag; + knora-base:standoffTagHasStart 17; + knora-base:standoffTagHasEnd 20; + knora-base:standoffTagHasStartIndex 4; + knora-base:standoffTagHasStartParent ; + knora-base:standoffTagHasUUID "0aaa6e47-0e9b-494f-9b6a-f42c66471d30" . +} diff --git a/webapi/src/test/resources/test-data/update/pr1322.trig b/webapi/src/test/resources/test-data/update/pr1322.trig new file mode 100644 index 0000000000..c3d8cc7662 --- /dev/null +++ b/webapi/src/test/resources/test-data/update/pr1322.trig @@ -0,0 +1,75 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix owl: . +@prefix knora-base: . +@prefix knora-admin: . +@prefix anything: . + + { + a anything:Thing; + knora-base:isDeleted false; + knora-base:attachedToUser ; + knora-base:attachedToProject ; + rdfs:label "A thing with version history"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:creationDate "2019-02-08T15:05:10Z"^^xsd:dateTime; + knora-base:lastModificationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; + anything:hasInteger ; + anything:hasText . + + a knora-base:IntValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-11T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasInteger 1; + knora-base:valueHasOrder 0; + knora-base:valueHasString "1"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser . + + a knora-base:IntValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-12T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasInteger 2; + knora-base:valueHasOrder 0; + knora-base:valueHasString "2"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:IntValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasInteger 3; + knora-base:valueHasOrder 0; + knora-base:valueHasString "3"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:TextValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-10T10:05:10Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "one"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser . + + a knora-base:TextValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-11T10:05:10Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "two"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:TextValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-12T10:05:10Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "three"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . +} diff --git a/webapi/src/test/resources/test-data/update/pr1367.trig b/webapi/src/test/resources/test-data/update/pr1367.trig new file mode 100644 index 0000000000..fc02d1671a --- /dev/null +++ b/webapi/src/test/resources/test-data/update/pr1367.trig @@ -0,0 +1,28 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix owl: . +@prefix knora-base: . +@prefix knora-admin: . +@prefix anything: . + + { + a anything:Thing; + knora-base:isDeleted false; + knora-base:attachedToUser ; + knora-base:attachedToProject ; + rdfs:label "A thing with a decimal value"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:creationDate "2019-02-08T15:05:10Z"^^xsd:dateTime; + knora-base:lastModificationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; + anything:hasDecimal . + + a knora-base:DecimalValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-11T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasDecimal "1.2"^^xsd:valueHasDecimal; + knora-base:valueHasOrder 0; + knora-base:valueHasString "1.2"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser . +} diff --git a/webapi/src/test/resources/test-data/update/pr1372.trig b/webapi/src/test/resources/test-data/update/pr1372.trig new file mode 100644 index 0000000000..ff3ec1a66b --- /dev/null +++ b/webapi/src/test/resources/test-data/update/pr1372.trig @@ -0,0 +1,105 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix owl: . +@prefix knora-base: . +@prefix knora-admin: . +@prefix anything: . + + { + a anything:Thing; + knora-base:isDeleted false; + knora-base:attachedToUser ; + knora-base:attachedToProject ; + rdfs:label "A thing with version history"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:creationDate "2019-02-08T15:05:10Z"^^xsd:dateTime; + knora-base:lastModificationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; + anything:hasInteger ; + anything:hasText ; + anything:hasOtherThing ; + anything:hasOtherThingValue . + + a knora-base:IntValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-11T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasInteger 1; + knora-base:valueHasOrder 0; + knora-base:valueHasString "1"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser . + + a knora-base:IntValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-12T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasInteger 2; + knora-base:valueHasOrder 0; + knora-base:valueHasString "2"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:IntValue; + knora-base:valueHasUUID "pLlW4ODASumZfZFbJdpw1g"^^xsd:string; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-13T09:05:10Z"^^xsd:dateTime; + knora-base:valueHasInteger 3; + knora-base:valueHasOrder 0; + knora-base:valueHasString "3"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:TextValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-10T10:05:10Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "one"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser . + + a knora-base:TextValue; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-11T10:05:10Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "two"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:TextValue; + knora-base:valueHasUUID "W5fm67e0QDWxRZumcXcs6g"^^xsd:string; + knora-base:isDeleted false; + knora-base:valueCreationDate "2019-02-12T10:05:10Z"^^xsd:dateTime; + knora-base:valueHasOrder 0; + knora-base:valueHasString "three"; + knora-base:hasPermissions "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:UnknownUser"; + knora-base:attachedToUser ; + knora-base:previousValue . + + a knora-base:LinkValue; + rdf:subject ; + rdf:predicate anything:hasOtherThing; + rdf:object ; + knora-base:isDeleted false; + knora-base:attachedToUser ; + knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember"; + knora-base:valueCreationDate "2019-02-10T10:30:10Z"^^xsd:dateTime; + knora-base:valueHasString "http://rdfh.ch/0001/2qMtTWvVRXWMBcRNlduvCQ"; + knora-base:valueHasRefCount 1 . + + a knora-base:LinkValue; + knora-base:valueHasUUID "IZGOjVqxTfSNO4ieKyp0SA"^^xsd:string; + rdf:subject ; + rdf:predicate anything:hasOtherThing; + rdf:object ; + knora-base:isDeleted true; + knora-base:deleteDate "2019-02-13T09:00:10Z"^^xsd:dateTime; + knora-base:deletedBy ; + knora-base:attachedToUser ; + knora-base:hasPermissions "V knora-admin:UnknownUser|M knora-admin:ProjectMember"; + knora-base:valueCreationDate "2019-02-13T09:00:10Z"^^xsd:dateTime; + knora-base:valueHasString "http://rdfh.ch/0001/2qMtTWvVRXWMBcRNlduvCQ"; + knora-base:valueHasRefCount 0; + knora-base:previousValue . +} diff --git a/webapi/src/test/scala/org/knora/webapi/e2e/v2/JSONLDHandlingV2R2RSpec.scala b/webapi/src/test/scala/org/knora/webapi/e2e/v2/JSONLDHandlingV2R2RSpec.scala index d7c604dc94..b813bbe064 100644 --- a/webapi/src/test/scala/org/knora/webapi/e2e/v2/JSONLDHandlingV2R2RSpec.scala +++ b/webapi/src/test/scala/org/knora/webapi/e2e/v2/JSONLDHandlingV2R2RSpec.scala @@ -83,9 +83,9 @@ class JSONLDHandlingV2R2RSpec extends R2RSpec { assert(status == StatusCodes.OK, response.toString) - val receivedJSONLDAsScala: Map[IRI, Any] = JavaUtil.deepJavatoScala(JsonUtils.fromString(responseAs[String])).asInstanceOf[Map[IRI, Any]] + val receivedJSONLDAsScala: Map[IRI, Any] = JavaUtil.deepJavaToScala(JsonUtils.fromString(responseAs[String])).asInstanceOf[Map[IRI, Any]] - val expectedJSONLDAsScala: Map[IRI, Any] = JavaUtil.deepJavatoScala(JsonUtils.fromString(FileUtil.readTextFile(new File("src/test/resources/test-data/resourcesR2RV2/NarrenschiffFirstPage.jsonld")))).asInstanceOf[Map[String, Any]] + val expectedJSONLDAsScala: Map[IRI, Any] = JavaUtil.deepJavaToScala(JsonUtils.fromString(FileUtil.readTextFile(new File("src/test/resources/test-data/resourcesR2RV2/NarrenschiffFirstPage.jsonld")))).asInstanceOf[Map[String, Any]] assert(receivedJSONLDAsScala("@context") == expectedJSONLDAsScala("@context"), "@context incorrect") diff --git a/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1307Spec.scala b/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1307Spec.scala new file mode 100644 index 0000000000..0a01a592b0 --- /dev/null +++ b/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1307Spec.scala @@ -0,0 +1,160 @@ +/* +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.webapi.update.plugins + +import org.eclipse.rdf4j.model.Model +import org.eclipse.rdf4j.repository.sail.SailRepository +import org.knora.webapi.messages.store.triplestoremessages.{SparqlSelectResponse, SparqlSelectResponseBody} + +class UpdatePluginPR1307Spec extends UpdatePluginSpec { + "Update plugin PR1307" should { + "update text values with standoff" in { + // Parse the input file. + val model: Model = trigFileToModel("src/test/resources/test-data/update/pr1307.trig") + + // Use the plugin to transform the input. + val plugin = new UpdatePluginPR1307 + plugin.transform(model) + + // Make an in-memory repository containing the transformed model. + val repository: SailRepository = makeRepository(model) + val connection = repository.getConnection + + // Check that knora-base:valueHasMaxStandoffStartIndex was added. + + val query1: String = + """ + |PREFIX knora-base: + | + |SELECT ?s ?maxStartIndex WHERE { + | ?s knora-base:valueHasMaxStandoffStartIndex ?maxStartIndex . + |} + |""".stripMargin + + val queryResult1: SparqlSelectResponse = doSelect(selectQuery = query1, connection = connection) + + val expectedResult1: SparqlSelectResponseBody = expectedResult( + Seq( + Map( + "s" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ", + "maxStartIndex" -> "7" + ) + ) + ) + + assert(queryResult1.results == expectedResult1) + + // Check that the standoff tags' IRIs were changed correctly. + + val query2: String = + """ + |PREFIX knora-base: + | + |SELECT ?tag WHERE { + | knora-base:valueHasStandoff ?tag . + |} ORDER BY ?tag + |""".stripMargin + + val queryResult2: SparqlSelectResponse = doSelect(selectQuery = query2, connection = connection) + + val expectedResult2: SparqlSelectResponseBody = expectedResult( + Seq( + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/0"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/2"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/3"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/4"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/5"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/6"), + Map("tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/7") + ) + ) + + assert(queryResult2.results == expectedResult2) + + // Check that the objects of knora-base:standoffTagHasStartParent were changed correctly. + + val query3: String = + """ + |PREFIX knora-base: + | + |SELECT ?tag ?startIndex ?startParent WHERE { + | ?tag knora-base:standoffTagHasStartIndex ?startIndex . + | + | OPTIONAL { + | ?tag knora-base:standoffTagHasStartParent ?startParent . + | } + |} ORDER BY ?tag + |""".stripMargin + + val queryResult3: SparqlSelectResponse = doSelect(selectQuery = query3, connection = connection) + + val expectedResult3: SparqlSelectResponseBody = expectedResult( + Seq( + Map( + "startIndex" -> "0", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/0" + ), + Map( + "startIndex" -> "1", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/0", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1" + ), + Map( + "startIndex" -> "2", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/2" + ), + Map( + "startIndex" -> "3", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/3" + ), + Map( + "startIndex" -> "4", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/4" + ), + Map( + "startIndex" -> "5", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/5" + ), + Map( + "startIndex" -> "6", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/6" + ), + Map( + "startIndex" -> "7", + "startParent" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/1", + "tag" -> "http://rdfh.ch/0001/qN1igiDRSAemBBktbRHn6g/values/xyUIf8QHS5aFrlt7Q4F1FQ/standoff/7" + ) + ) + ) + + assert(queryResult3.results == expectedResult3) + connection.close() + repository.shutDown() + } + } +} +*/ diff --git a/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1322Spec.scala b/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1322Spec.scala new file mode 100644 index 0000000000..9b3188c43c --- /dev/null +++ b/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1322Spec.scala @@ -0,0 +1,72 @@ +/* +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.webapi.update.plugins + +import org.eclipse.rdf4j.model.Model +import org.eclipse.rdf4j.repository.sail.SailRepository +import org.knora.webapi.messages.store.triplestoremessages.{SparqlSelectResponse, SparqlSelectResponseBody} + +class UpdatePluginPR1322Spec extends UpdatePluginSpec { + "Update plugin PR1322" should { + "add UUIDs to values" in { + // Parse the input file. + val model: Model = trigFileToModel("src/test/resources/test-data/update/pr1322.trig") + + // Use the plugin to transform the input. + val plugin = new UpdatePluginPR1322 + plugin.transform(model) + + // Make an in-memory repository containing the transformed model. + val repository: SailRepository = makeRepository(model) + val connection = repository.getConnection + + // Check that UUIDs were added. + + val query: String = + """ + |PREFIX knora-base: + | + |SELECT ?value WHERE { + | ?value knora-base:valueHasUUID ?valueHasUUID . + |} ORDER BY ?value + |""".stripMargin + + val queryResult1: SparqlSelectResponse = doSelect(selectQuery = query, connection = connection) + + val expectedResultBody: SparqlSelectResponseBody = expectedResult( + Seq( + Map( + "value" -> "http://rdfh.ch/0001/thing-with-history/values/1c" + ), + Map( + "value" -> "http://rdfh.ch/0001/thing-with-history/values/2c" + ) + ) + ) + + assert(queryResult1.results == expectedResultBody) + + connection.close() + repository.shutDown() + } + } +} +*/ diff --git a/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1367Spec.scala b/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1367Spec.scala new file mode 100644 index 0000000000..9286f93da2 --- /dev/null +++ b/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1367Spec.scala @@ -0,0 +1,52 @@ +/* +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.webapi.update.plugins + +import org.eclipse.rdf4j.model.impl.SimpleValueFactory +import org.eclipse.rdf4j.model.util.Models +import org.eclipse.rdf4j.model.{Literal, Model} +import org.knora.webapi.OntologyConstants +import org.knora.webapi.util.JavaUtil._ + +class UpdatePluginPR1367Spec extends UpdatePluginSpec { + private val valueFactory = SimpleValueFactory.getInstance + + "Update plugin PR1367" should { + "fix the datatypes of decimal literals" in { + // Parse the input file. + val model: Model = trigFileToModel("src/test/resources/test-data/update/pr1367.trig") + + // Use the plugin to transform the input. + val plugin = new UpdatePluginPR1367 + plugin.transform(model) + + // Check that the decimal datatype was fixed. + val literal: Literal = Models.getPropertyLiteral( + model, + valueFactory.createIRI("http://rdfh.ch/0001/thing-with-history/values/1"), + valueFactory.createIRI(OntologyConstants.KnoraBase.ValueHasDecimal) + ).toOption.get + + assert(literal.getDatatype == valueFactory.createIRI(OntologyConstants.Xsd.Decimal)) + } + } +} +*/ diff --git a/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1372Spec.scala b/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1372Spec.scala new file mode 100644 index 0000000000..f8c6cd1374 --- /dev/null +++ b/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1372Spec.scala @@ -0,0 +1,76 @@ +/* +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.webapi.update.plugins + +import org.eclipse.rdf4j.model.Model +import org.eclipse.rdf4j.repository.sail.SailRepository +import org.knora.webapi.messages.store.triplestoremessages.{SparqlSelectResponse, SparqlSelectResponseBody} + +class UpdatePluginPR1372Spec extends UpdatePluginSpec { + "Update plugin PR1372" should { + "remove permissions from past versions of values" in { + // Parse the input file. + val model: Model = trigFileToModel("src/test/resources/test-data/update/pr1372.trig") + + // Use the plugin to transform the input. + val plugin = new UpdatePluginPR1372 + plugin.transform(model) + + // Make an in-memory repository containing the transformed model. + val repository: SailRepository = makeRepository(model) + val connection = repository.getConnection + + // Check that permissions were removed. + + val query: String = + """ + |PREFIX knora-base: + | + |SELECT ?value WHERE { + | ?value knora-base:valueCreationDate ?creationDate ; + | knora-base:hasPermissions ?permissions . + |} ORDER BY ?value + |""".stripMargin + + val queryResult1: SparqlSelectResponse = doSelect(selectQuery = query, connection = connection) + + val expectedResultBody: SparqlSelectResponseBody = expectedResult( + Seq( + Map( + "value" -> "http://rdfh.ch/0001/thing-with-history/values/1c" + ), + Map( + "value" -> "http://rdfh.ch/0001/thing-with-history/values/2c" + ), + Map( + "value" -> "http://rdfh.ch/0001/thing-with-history/values/3b" + ) + ) + ) + + assert(queryResult1.results == expectedResultBody) + + connection.close() + repository.shutDown() + } + } +} +*/ diff --git a/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginSpec.scala b/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginSpec.scala new file mode 100644 index 0000000000..e985eeed2a --- /dev/null +++ b/webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginSpec.scala @@ -0,0 +1,119 @@ +/* +/* + * Copyright © 2015-2019 the contributors (see Contributors.md). + * + * This file is part of Knora. + * + * Knora 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. + * + * Knora 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 Knora. If not, see . + */ + +package org.knora.webapi.update.plugins + +import java.io.{BufferedReader, FileReader} + +import org.eclipse.rdf4j.model.Model +import org.eclipse.rdf4j.model.impl.LinkedHashModel +import org.eclipse.rdf4j.query.{Binding, TupleQuery, TupleQueryResult} +import org.eclipse.rdf4j.repository.sail.{SailRepository, SailRepositoryConnection} +import org.eclipse.rdf4j.rio.helpers.StatementCollector +import org.eclipse.rdf4j.rio.{RDFFormat, RDFParser, Rio} +import org.eclipse.rdf4j.sail.memory.MemoryStore +import org.knora.webapi.CoreSpec +import org.knora.webapi.messages.store.triplestoremessages.{SparqlSelectResponse, SparqlSelectResponseBody, SparqlSelectResponseHeader, VariableResultsRow} +import org.knora.webapi.util.ErrorHandlingMap + +import scala.collection.JavaConverters._ +import scala.collection.mutable.ArrayBuffer + +/** + * Provides helper methods for specs that test update plugins. + */ +abstract class UpdatePluginSpec extends CoreSpec { + /** + * Parses a TriG file and returns it as an RDF4J [[Model]]. + * + * @param path the file path of the TriG file. + * @return a [[Model]]. + */ + def trigFileToModel(path: String): Model = { + val trigParser: RDFParser = Rio.createParser(RDFFormat.TRIG) + val fileReader = new BufferedReader(new FileReader(path)) + val model = new LinkedHashModel() + trigParser.setRDFHandler(new StatementCollector(model)) + trigParser.parse(fileReader, "") + model + } + + /** + * Makes an in-memory RDF4J [[SailRepository]] containing a [[Model]]. + * + * @param model the model to be added to the repository. + * @return the repository. + */ + def makeRepository(model: Model): SailRepository = { + val repository = new SailRepository(new MemoryStore()) + repository.init() + val connection: SailRepositoryConnection = repository.getConnection + connection.add(model) + connection.close() + repository + } + + /** + * Wraps expected SPARQL SELECT results in a [[SparqlSelectResponseBody]]. + * + * @param rows the expected results. + * @return a [[SparqlSelectResponseBody]] containing the expected results. + */ + def expectedResult(rows: Seq[Map[String, String]]): SparqlSelectResponseBody = { + val rowMaps = rows.map { + mapToWrap => VariableResultsRow(new ErrorHandlingMap[String, String](mapToWrap, { key: String => s"No value found for SPARQL query variable '$key' in query result row" })) + } + + SparqlSelectResponseBody(bindings = rowMaps) + } + + /** + * Does a SPARQL SELECT query using a connection to an RDF4J [[SailRepository]]. + * + * @param selectQuery the query. + * @param connection a connection to the repository. + * @return a [[SparqlSelectResponse]] containing the query results. + */ + def doSelect(selectQuery: String, connection: SailRepositoryConnection): SparqlSelectResponse = { + val tupleQuery: TupleQuery = connection.prepareTupleQuery(selectQuery) + val tupleQueryResult: TupleQueryResult = tupleQuery.evaluate + + val header = SparqlSelectResponseHeader(tupleQueryResult.getBindingNames.asScala) + val rowBuffer = ArrayBuffer.empty[VariableResultsRow] + + while (tupleQueryResult.hasNext) { + val bindings: Iterable[Binding] = tupleQueryResult.next.asScala + + val rowMap: Map[String, String] = bindings.map { + binding => binding.getName -> binding.getValue.stringValue + }.toMap + + rowBuffer.append(VariableResultsRow(new ErrorHandlingMap[String, String](rowMap, { key: String => s"No value found for SPARQL query variable '$key' in query result row" }))) + } + + tupleQueryResult.close() + + SparqlSelectResponse( + head = header, + results = SparqlSelectResponseBody(bindings = rowBuffer) + ) + } +} +*/ diff --git a/webapi/src/test/scala/org/knora/webapi/util/AkkaHttpUtils.scala b/webapi/src/test/scala/org/knora/webapi/util/AkkaHttpUtils.scala index 31fb8fc740..e995de6a73 100644 --- a/webapi/src/test/scala/org/knora/webapi/util/AkkaHttpUtils.scala +++ b/webapi/src/test/scala/org/knora/webapi/util/AkkaHttpUtils.scala @@ -96,7 +96,7 @@ object AkkaHttpUtils extends LazyLogging { println("expanded json-ld: " + expanded) */ - JavaUtil.deepJavatoScala(normalized).asInstanceOf[Map[String, Any]] + JavaUtil.deepJavaToScala(normalized).asInstanceOf[Map[String, Any]] } }