Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
acdc
repository-extension-services
Commits
1930a4ed
Commit
1930a4ed
authored
Jul 04, 2016
by
acoburn
Browse files
Rename 'validation' service to reflect what it actually does, namely: type inference
parent
4610c0f0
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
77 additions
and
129 deletions
+77
-129
README.md
README.md
+2
-2
acrepo-itests/src/test/java/edu/amherst/acdc/itests/AcrepoServicesIT.java
...c/test/java/edu/amherst/acdc/itests/AcrepoServicesIT.java
+2
-2
acrepo-karaf/pom.xml
acrepo-karaf/pom.xml
+1
-1
acrepo-karaf/src/main/resources/features.xml
acrepo-karaf/src/main/resources/features.xml
+3
-5
acrepo-karaf/src/test/java/edu/amherst/acdc/karaf/KarafIT.java
...o-karaf/src/test/java/edu/amherst/acdc/karaf/KarafIT.java
+4
-4
acrepo-services-inference/README.md
acrepo-services-inference/README.md
+5
-4
acrepo-services-inference/pom.xml
acrepo-services-inference/pom.xml
+4
-28
acrepo-services-inference/src/main/java/edu/amherst/acdc/services/inference/InferenceService.java
...edu/amherst/acdc/services/inference/InferenceService.java
+6
-5
acrepo-services-inference/src/main/java/edu/amherst/acdc/services/inference/InferenceServiceImpl.java
...amherst/acdc/services/inference/InferenceServiceImpl.java
+11
-32
acrepo-services-inference/src/main/resources/OSGI-INF/blueprint/validation-service.xml
.../main/resources/OSGI-INF/blueprint/validation-service.xml
+3
-11
acrepo-services-inference/src/test/java/edu/amherst/acdc/services/inference/InferenceServiceTest.java
...amherst/acdc/services/inference/InferenceServiceTest.java
+21
-20
acrepo-services-inference/src/test/resources/applicationProfile.ttl
...vices-inference/src/test/resources/applicationProfile.ttl
+2
-2
acrepo-services-inference/src/test/resources/hasPrefLabel.ttl
...po-services-inference/src/test/resources/hasPrefLabel.ttl
+2
-2
acrepo-services-inference/src/test/resources/hasValue.ttl
acrepo-services-inference/src/test/resources/hasValue.ttl
+2
-2
acrepo-services-inference/src/test/resources/intersectionOf.ttl
...-services-inference/src/test/resources/intersectionOf.ttl
+2
-2
acrepo-services-inference/src/test/resources/isBinary.ttl
acrepo-services-inference/src/test/resources/isBinary.ttl
+2
-2
acrepo-services-inference/src/test/resources/isResource.ttl
acrepo-services-inference/src/test/resources/isResource.ttl
+2
-2
acrepo-services-inference/src/test/resources/isResourceSubClass.ttl
...vices-inference/src/test/resources/isResourceSubClass.ttl
+2
-2
acrepo-services-inference/src/test/resources/logback-test.xml
...po-services-inference/src/test/resources/logback-test.xml
+1
-1
acrepo-services-inference/src/test/resources/resource.ttl
acrepo-services-inference/src/test/resources/resource.ttl
+0
-0
No files found.
README.md
View file @
1930a4ed
...
...
@@ -24,12 +24,12 @@ Services
These modules provide particular services, independent of Fedora Resources.
*
`acrepo-services-inference`
: An OSGi-based structural typing service using owl inference
*
`acrepo-services-jsonld`
: This service creates expanded or compact JSON-LD representations of input documents
*
`acrepo-services-ldcache`
: This service dereferences and caches URIs, retrieving the
`object`
of particular triples on demand
*
`acrepo-services-ldcache-file`
: A file-based backend for the
`acrepo-services-ldcache`
service
*
`acrepo-services-mint`
: This mints random (public) URIs for use with Fedora resources
*
`acrepo-services-pcdm`
: This makes it easy to work with PCDM objects
*
`acrepo-services-validation`
: An OSGi-based validation service
Connectors
----------
...
...
@@ -79,12 +79,12 @@ command from its shell:
feature:install acrepo-exts-serialize-xml
feature:install acrepo-exts-template
feature:install acrepo-services-inference
feature:install acrepo-services-jsonld
feature:install acrepo-services-ldcache
feature:install acrepo-services-ldcache-file
feature:install acrepo-services-mint
feature:install acrepo-services-pcdm
feature:install acrepo-services-validation
More information
----------------
...
...
acrepo-itests/src/test/java/edu/amherst/acdc/itests/AcrepoServicesIT.java
View file @
1930a4ed
...
...
@@ -83,7 +83,7 @@ public class AcrepoServicesIT extends AbstractOSGiIT {
"acrepo-libs-jena"
,
"acrepo-libs-sesame"
,
"acrepo-libs-jsonld"
,
"acrepo-libs-jackson"
,
"acrepo-libs-marmotta"
,
"acrepo-services-jsonld"
,
"acrepo-services-ldcache"
,
"acrepo-services-mint"
,
"acrepo-services-pcdm"
,
"acrepo-services-
validation
"
,
"acrepo-services-mint"
,
"acrepo-services-pcdm"
,
"acrepo-services-
inference
"
,
"acrepo-connector-broadcast"
),
editConfigurationFilePut
(
"etc/edu.amherst.acdc.exts.fits.cfg"
,
"rest.port"
,
fitsPort
),
...
...
@@ -115,10 +115,10 @@ public class AcrepoServicesIT extends AbstractOSGiIT {
assertTrue
(
featuresService
.
isInstalled
(
featuresService
.
getFeature
(
"acrepo-libs-jsonld"
)));
assertTrue
(
featuresService
.
isInstalled
(
featuresService
.
getFeature
(
"acrepo-libs-marmotta"
)));
assertTrue
(
featuresService
.
isInstalled
(
featuresService
.
getFeature
(
"acrepo-libs-sesame"
)));
assertTrue
(
featuresService
.
isInstalled
(
featuresService
.
getFeature
(
"acrepo-services-inference"
)));
assertTrue
(
featuresService
.
isInstalled
(
featuresService
.
getFeature
(
"acrepo-services-jsonld"
)));
assertTrue
(
featuresService
.
isInstalled
(
featuresService
.
getFeature
(
"acrepo-services-ldcache"
)));
assertTrue
(
featuresService
.
isInstalled
(
featuresService
.
getFeature
(
"acrepo-services-mint"
)));
assertTrue
(
featuresService
.
isInstalled
(
featuresService
.
getFeature
(
"acrepo-services-pcdm"
)));
assertTrue
(
featuresService
.
isInstalled
(
featuresService
.
getFeature
(
"acrepo-services-validation"
)));
}
}
acrepo-karaf/pom.xml
View file @
1930a4ed
...
...
@@ -38,7 +38,7 @@
<dependency>
<groupId>
edu.amherst.acdc
</groupId>
<artifactId>
acrepo-services-
validation
</artifactId>
<artifactId>
acrepo-services-
inference
</artifactId>
<scope>
test
</scope>
<version>
${project.version}
</version>
</dependency>
...
...
acrepo-karaf/src/main/resources/features.xml
View file @
1930a4ed
...
...
@@ -108,14 +108,12 @@
<bundle>
mvn:edu.amherst.acdc/acrepo-services-pcdm/${project.version}
</bundle>
</feature>
<feature
name=
"acrepo-services-
validation
"
version=
"${project.version}"
>
<details>
Installs the
validation
service
</details>
<feature
name=
"acrepo-services-
inference
"
version=
"${project.version}"
>
<details>
Installs the
inference
service
</details>
<feature
version=
"${project.version}"
>
acrepo-libs-jena
</feature>
<bundle>
mvn:edu.amherst.acdc/acrepo-services-validation/${project.version}
</bundle>
<configfile
finalname=
"/etc/edu.amherst.acdc.services.validation.cfg"
>
mvn:edu.amherst.acdc/acrepo-services-validation/${project.version}/cfg/configuration
</configfile>
<bundle>
mvn:edu.amherst.acdc/acrepo-services-inference/${project.version}
</bundle>
</feature>
<feature
name=
"acrepo-exts-serialize-xml"
version=
"${project.version}"
>
...
...
acrepo-karaf/src/test/java/edu/amherst/acdc/karaf/KarafIT.java
View file @
1930a4ed
...
...
@@ -78,7 +78,7 @@ public class KarafIT {
final
String
version
=
cm
.
getProperty
(
"project.version"
);
final
String
acrepoIdiomatic
=
getBundleUri
(
"acrepo-connector-idiomatic"
,
version
);
final
String
acrepoPcdmSvc
=
getBundleUri
(
"acrepo-services-pcdm"
,
version
);
final
String
acrepo
Validation
Svc
=
getBundleUri
(
"acrepo-services-
validation
"
,
version
);
final
String
acrepo
Inference
Svc
=
getBundleUri
(
"acrepo-services-
inference
"
,
version
);
final
String
acrepoJsonLdSvc
=
getBundleUri
(
"acrepo-services-jsonld"
,
version
);
final
String
acrepoJsonLd
=
getBundleUri
(
"acrepo-exts-jsonld"
,
version
);
final
String
acrepoMintSvc
=
getBundleUri
(
"acrepo-services-mint"
,
version
);
...
...
@@ -113,14 +113,14 @@ public class KarafIT {
mavenBundle
().
groupId
(
"com.github.andrewoma.dexx"
).
artifactId
(
"collection"
).
versionAsInProject
(),
CoreOptions
.
systemProperty
(
"acdc.idiomatic-bundle"
).
value
(
acrepoIdiomatic
),
CoreOptions
.
systemProperty
(
"acdc.
validation
-svc-bundle"
).
value
(
acrepo
Validation
Svc
),
CoreOptions
.
systemProperty
(
"acdc.
inference
-svc-bundle"
).
value
(
acrepo
Inference
Svc
),
CoreOptions
.
systemProperty
(
"acdc.jsonld-bundle"
).
value
(
acrepoJsonLd
),
CoreOptions
.
systemProperty
(
"acdc.jsonld-svc-bundle"
).
value
(
acrepoJsonLdSvc
),
CoreOptions
.
systemProperty
(
"acdc.mint-svc-bundle"
).
value
(
acrepoMintSvc
),
CoreOptions
.
systemProperty
(
"acdc.pcdm-svc-bundle"
).
value
(
acrepoPcdmSvc
),
bundle
(
acrepoIdiomatic
).
start
(),
bundle
(
acrepo
Validation
Svc
).
start
(),
bundle
(
acrepo
Inference
Svc
).
start
(),
bundle
(
acrepoJsonLd
).
start
(),
bundle
(
acrepoJsonLdSvc
).
start
(),
bundle
(
acrepoMintSvc
).
start
(),
...
...
@@ -144,7 +144,7 @@ public class KarafIT {
assertNotNull
(
bundleContext
);
assertEquals
(
ACTIVE
,
bundleContext
.
getBundle
(
System
.
getProperty
(
"acdc.idiomatic-bundle"
)).
getState
());
assertEquals
(
ACTIVE
,
bundleContext
.
getBundle
(
System
.
getProperty
(
"acdc.
validation
-svc-bundle"
)).
getState
());
assertEquals
(
ACTIVE
,
bundleContext
.
getBundle
(
System
.
getProperty
(
"acdc.
inference
-svc-bundle"
)).
getState
());
assertEquals
(
ACTIVE
,
bundleContext
.
getBundle
(
System
.
getProperty
(
"acdc.jsonld-bundle"
)).
getState
());
assertEquals
(
ACTIVE
,
bundleContext
.
getBundle
(
System
.
getProperty
(
"acdc.jsonld-svc-bundle"
)).
getState
());
assertEquals
(
ACTIVE
,
bundleContext
.
getBundle
(
System
.
getProperty
(
"acdc.mint-svc-bundle"
)).
getState
());
...
...
acrepo-services-
validation
/README.md
→
acrepo-services-
inference
/README.md
View file @
1930a4ed
Repository
Validation
Service
============================
=
Repository
Inference
Service
============================
This OSGi service validates RDF documents using OWL restrictions.
This OSGi service can do structural typing of RDF graphs using OWL restrictions.
It does _not_ do validation!
Building
--------
...
...
@@ -18,5 +19,5 @@ Each of these projects can be deployed in an OSGi container. For example using
command from its shell:
feature:repo-add mvn:edu.amherst.acdc/acrepo-karaf/LATEST/xml/features
feature:install acrepo-services-
validation
feature:install acrepo-services-
inference
acrepo-services-
validation
/pom.xml
→
acrepo-services-
inference
/pom.xml
View file @
1930a4ed
...
...
@@ -9,14 +9,14 @@
<version>
1.0.1-SNAPSHOT
</version>
</parent>
<artifactId>
acrepo-services-
validation
</artifactId>
<artifactId>
acrepo-services-
inference
</artifactId>
<packaging>
bundle
</packaging>
<name>
RDF
Validation
service bundle
</name>
<description>
An OSGi service that
validates an RDF document
based on a set of OWL restrictions.
</description>
<name>
RDF
inference
service bundle
</name>
<description>
An OSGi service that
does structural typing of RDF graphs
based on a set of OWL restrictions.
</description>
<properties>
<osgi.export.packages>
edu.amherst.acdc.services.
validation
;version=${project.version}
</osgi.export.packages>
<osgi.export.packages>
edu.amherst.acdc.services.
inference
;version=${project.version}
</osgi.export.packages>
</properties>
<dependencies>
...
...
@@ -79,30 +79,6 @@
<artifactId>
maven-failsafe-plugin
</artifactId>
</plugin>
<!-- add configuration file to artifact set for OSGi deployment -->
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
build-helper-maven-plugin
</artifactId>
<executions>
<execution>
<phase>
package
</phase>
<goals>
<goal>
attach-artifact
</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>
src/main/cfg/edu.amherst.acdc.services.validation.cfg
</file>
<type>
cfg
</type>
<classifier>
configuration
</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
...
acrepo-services-
validation
/src/main/java/edu/amherst/acdc/services/
validation/Validation
Service.java
→
acrepo-services-
inference
/src/main/java/edu/amherst/acdc/services/
inference/Inference
Service.java
View file @
1930a4ed
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
edu.amherst.acdc.services.
validation
;
package
edu.amherst.acdc.services.
inference
;
import
java.io.InputStream
;
...
...
@@ -21,18 +21,19 @@ import java.io.InputStream;
* @author acoburn
* @since 6/16/16
*/
public
interface
Validation
Service
{
public
interface
Inference
Service
{
/**
* Determine whether an RDF graph
is valid according to
a set of OWL restrictions
* Determine whether an RDF graph
has an inferred type, given
a set of OWL restrictions
*
* @param subject The subject of the RDF graph
* @param type The inferred type
* @param input The input RDF graph
* @param contentType The mimeType of the input
* @param restrictions any OWL restrictions
* @param restrictionFormat the mimeType of the restriction graph
* @return
whether the input document is valid
* @return
given the RDF document and restiction set, does the given subject have the provided type
*/
boolean
validat
e
(
final
String
subject
,
final
InputStream
input
,
final
String
contentType
,
boolean
hasTyp
e
(
final
String
subject
,
final
String
type
,
final
InputStream
input
,
final
String
contentType
,
final
InputStream
restrictions
,
final
String
restrictionFormat
);
}
acrepo-services-
validation
/src/main/java/edu/amherst/acdc/services/
validation/Validation
ServiceImpl.java
→
acrepo-services-
inference
/src/main/java/edu/amherst/acdc/services/
inference/Inference
ServiceImpl.java
View file @
1930a4ed
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
edu.amherst.acdc.services.
validation
;
package
edu.amherst.acdc.services.
inference
;
import
static
org
.
apache
.
jena
.
rdf
.
model
.
ModelFactory
.
createDefaultModel
;
import
static
org
.
apache
.
jena
.
rdf
.
model
.
ModelFactory
.
createInfModel
;
...
...
@@ -28,38 +28,21 @@ import java.io.InputStream;
import
org.apache.jena.rdf.model.InfModel
;
import
org.apache.jena.rdf.model.Model
;
import
org.apache.jena.rdf.model.Resource
;
import
org.apache.jena.reasoner.ValidityReport
;
import
org.slf4j.Logger
;
/**
* @author acoburn
* @since 6/16/16
*/
public
class
Validation
ServiceImpl
implements
Validation
Service
{
public
class
Inference
ServiceImpl
implements
Inference
Service
{
private
static
final
Logger
LOGGER
=
getLogger
(
Validation
ServiceImpl
.
class
);
private
static
final
Logger
LOGGER
=
getLogger
(
Inference
ServiceImpl
.
class
);
private
final
Resource
validationType
;
/**
* Instantiate a ValidationService object
* @param validType a URI for the RDF type used for validation.
*/
public
ValidationServiceImpl
(
final
String
validType
)
{
this
.
validationType
=
createResource
(
validType
);
}
/**
* Generate a compact representation of the input stream
*
* @param input The input JSON document
* @param contextUrl the location of a context URL
* @return the compacted JSON Object
*/
@Override
public
boolean
validat
e
(
final
String
subject
,
final
InputStream
input
,
final
String
contentType
,
final
InputStream
restrictions
,
final
String
restrictionFormat
)
{
public
boolean
hasTyp
e
(
final
String
subject
,
final
String
rdfType
,
final
InputStream
input
,
final
String
contentType
,
final
InputStream
restrictions
,
final
String
restrictionFormat
)
{
final
Resource
inferredType
=
createResource
(
rdfType
);
final
Resource
subjectResource
=
createResource
(
subject
);
final
Model
model
=
createDefaultModel
();
model
.
read
(
input
,
subject
,
contentTypeToLang
(
contentType
).
getName
());
...
...
@@ -68,17 +51,13 @@ public class ValidationServiceImpl implements ValidationService {
schema
.
read
(
restrictions
,
null
,
contentTypeToLang
(
restrictionFormat
).
getName
());
if
(
model
.
contains
(
subjectResource
,
type
,
inferredType
))
{
return
true
;
}
final
InfModel
infmodel
=
createInfModel
(
getOWLReasoner
(),
model
);
infmodel
.
add
(
schema
);
final
ValidityReport
validity
=
infmodel
.
validate
();
if
(
validity
.
isValid
())
{
return
infmodel
.
contains
(
subjectResource
,
type
,
validationType
);
}
validity
.
getReports
().
forEachRemaining
(
report
->
{
LOGGER
.
warn
(
report
.
toString
());
});
return
false
;
return
infmodel
.
contains
(
subjectResource
,
type
,
inferredType
);
}
}
acrepo-services-
validation
/src/main/resources/OSGI-INF/blueprint/validation-service.xml
→
acrepo-services-
inference
/src/main/resources/OSGI-INF/blueprint/validation-service.xml
View file @
1930a4ed
...
...
@@ -7,19 +7,11 @@
http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd"
default-activation=
"lazy"
>
<cm:property-placeholder
persistent-id=
"edu.amherst.acdc.services.validation"
update-strategy=
"reload"
>
<cm:default-properties>
<cm:property
name=
"validation.type"
value=
"urn:validation#Valid"
/>
</cm:default-properties>
</cm:property-placeholder>
<bean
id=
"inferenceServiceBean"
class=
"edu.amherst.acdc.services.inference.InferenceServiceImpl"
/>
<bean
id=
"validationServiceBean"
class=
"edu.amherst.acdc.services.validation.ValidationServiceImpl"
>
<argument
value=
"${validation.type}"
/>
</bean>
<service
ref=
"validationServiceBean"
interface=
"edu.amherst.acdc.services.validation.ValidationService"
>
<service
ref=
"inferenceServiceBean"
interface=
"edu.amherst.acdc.services.inference.InferenceService"
>
<service-properties>
<entry
key=
"osgi.jndi.service.name"
value=
"
validation
"
/>
<entry
key=
"osgi.jndi.service.name"
value=
"
inference
"
/>
</service-properties>
</service>
...
...
acrepo-services-
validation
/src/test/java/edu/amherst/acdc/services/
validation/Validation
ServiceTest.java
→
acrepo-services-
inference
/src/test/java/edu/amherst/acdc/services/
inference/Inference
ServiceTest.java
View file @
1930a4ed
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
edu.amherst.acdc.services.
validation
;
package
edu.amherst.acdc.services.
inference
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
...
...
@@ -24,69 +24,70 @@ import org.junit.Test;
* @author acoburn
* @since 6/16/16
*/
public
class
Validation
ServiceTest
{
public
class
Inference
ServiceTest
{
private
final
String
TURTLE
=
"text/turtle"
;
private
final
String
subject
=
"http://localhost:8080/fcrepo/rest/test"
;
private
final
ValidationService
svc
=
new
ValidationServiceImpl
(
"urn:validation#Valid"
);
private
final
String
appType
=
"urn:app#Complete"
;
private
final
InferenceService
svc
=
new
InferenceServiceImpl
();
@Test
public
void
test
Validate
IsEquivalentClass
()
{
assertTrue
(
svc
.
validat
e
(
subject
,
public
void
testIsEquivalentClass
()
{
assertTrue
(
svc
.
hasTyp
e
(
subject
,
appType
,
getClass
().
getResourceAsStream
(
"/resource.ttl"
),
TURTLE
,
getClass
().
getResourceAsStream
(
"/isResource.ttl"
),
TURTLE
));
}
@Test
public
void
test
Validate
IsNotEquivalentClass
()
{
assertFalse
(
svc
.
validat
e
(
subject
,
public
void
testIsNotEquivalentClass
()
{
assertFalse
(
svc
.
hasTyp
e
(
subject
,
appType
,
getClass
().
getResourceAsStream
(
"/resource.ttl"
),
TURTLE
,
getClass
().
getResourceAsStream
(
"/isBinary.ttl"
),
TURTLE
));
}
@Test
public
void
test
Validate
HasValue
()
{
assertTrue
(
svc
.
validat
e
(
subject
,
public
void
testHasValue
()
{
assertTrue
(
svc
.
hasTyp
e
(
subject
,
appType
,
getClass
().
getResourceAsStream
(
"/resource.ttl"
),
TURTLE
,
getClass
().
getResourceAsStream
(
"/hasValue.ttl"
),
TURTLE
));
}
@Test
public
void
test
Validate
Cardinality
()
{
assertTrue
(
svc
.
validat
e
(
subject
,
public
void
testCardinality
()
{
assertTrue
(
svc
.
hasTyp
e
(
subject
,
appType
,
getClass
().
getResourceAsStream
(
"/resource.ttl"
),
TURTLE
,
getClass
().
getResourceAsStream
(
"/hasPrefLabel.ttl"
),
TURTLE
));
}
@Test
public
void
test
Validate
ResourceSubClass
()
{
assertTrue
(
svc
.
validat
e
(
subject
,
public
void
testResourceSubClass
()
{
assertTrue
(
svc
.
hasTyp
e
(
subject
,
appType
,
getClass
().
getResourceAsStream
(
"/resource.ttl"
),
TURTLE
,
getClass
().
getResourceAsStream
(
"/isResourceSubClass.ttl"
),
TURTLE
));
}
@Test
public
void
test
Validate
IntersectionOf
()
{
assertTrue
(
svc
.
validat
e
(
subject
,
public
void
testIntersectionOf
()
{
assertTrue
(
svc
.
hasTyp
e
(
subject
,
appType
,
getClass
().
getResourceAsStream
(
"/resource.ttl"
),
TURTLE
,
getClass
().
getResourceAsStream
(
"/intersectionOf.ttl"
),
TURTLE
));
}
@Test
public
void
test
Validate
UnionOf
()
{
assertTrue
(
svc
.
validat
e
(
subject
,
public
void
testUnionOf
()
{
assertTrue
(
svc
.
hasTyp
e
(
subject
,
appType
,
getClass
().
getResourceAsStream
(
"/resource.ttl"
),
TURTLE
,
getClass
().
getResourceAsStream
(
"/unionOf.ttl"
),
TURTLE
));
}
@Test
public
void
test
Validate
ApplicationProfile
()
{
assertTrue
(
svc
.
validat
e
(
subject
,
public
void
testApplicationProfile
()
{
assertTrue
(
svc
.
hasTyp
e
(
subject
,
appType
,
getClass
().
getResourceAsStream
(
"/resource.ttl"
),
TURTLE
,
getClass
().
getResourceAsStream
(
"/applicationProfile.ttl"
),
TURTLE
));
}
}
acrepo-services-
validation
/src/test/resources/applicationProfile.ttl
→
acrepo-services-
inference
/src/test/resources/applicationProfile.ttl
View file @
1930a4ed
...
...
@@ -2,11 +2,11 @@
@prefix
skos:
<http://www.w3.org/2004/02/skos/core#>
.
@prefix
xsd:
<http://www.w3.org/2001/XMLSchema#>
.
@prefix
fedora:
<http://fedora.info/definitions/v4/repository#>
.
@prefix
validation:
<urn:validation
#>
.
@prefix
app:
<urn:app
#>
.
@prefix
pcdm:
<http://pcdm.org/models#>
.
@prefix
dcterms:
<http://purl.org/dc/terms/>
.
validation:
Valid
owl:
equivalentClass
[
app:
Complete
owl:
equivalentClass
[
owl:
intersectionOf
(
pcdm:
Object
[
a
owl:
Restriction
;
...
...
acrepo-services-
validation
/src/test/resources/hasPrefLabel.ttl
→
acrepo-services-
inference
/src/test/resources/hasPrefLabel.ttl
View file @
1930a4ed
@prefix
owl:
<http://www.w3.org/2002/07/owl#>
.
@prefix
skos:
<http://www.w3.org/2004/02/skos/core#>
.
@prefix
xsd:
<http://www.w3.org/2001/XMLSchema#>
.
@prefix
validation:
<urn:validation
#>
.
@prefix
app:
<urn:app
#>
.
validation:
Valid
owl:
equivalentClass
[
a
owl:
Restriction
;
app:
Complete
owl:
equivalentClass
[
a
owl:
Restriction
;
owl:
onProperty
skos:
prefLabel
;
owl:
minCardinality
"1"
^^
xsd:
nonNegativeInteger
]
.
acrepo-services-
validation
/src/test/resources/hasValue.ttl
→
acrepo-services-
inference
/src/test/resources/hasValue.ttl
View file @
1930a4ed
@prefix
owl:
<http://www.w3.org/2002/07/owl#>
.
@prefix
fedora:
<http://fedora.info/definitions/v4/repository#>
.
@prefix
validation:
<urn:validation#>
.
@prefix
xsd:
<http://www.w3.org/2001/XMLSchema#>
.
@prefix
app:
<urn:app#>
.
validation:
Valid
owl:
equivalentClass
[
a
owl:
Restriction
;
app:
Complete
owl:
equivalentClass
[
a
owl:
Restriction
;
owl:
onProperty
fedora:
numberOfChildren
;
owl:
hasValue
"6"
^^
xsd:
long
]
.
acrepo-services-
validation
/src/test/resources/intersectionOf.ttl
→
acrepo-services-
inference
/src/test/resources/intersectionOf.ttl
View file @
1930a4ed
...
...
@@ -2,9 +2,9 @@
@prefix
skos:
<http://www.w3.org/2004/02/skos/core#>
.
@prefix
xsd:
<http://www.w3.org/2001/XMLSchema#>
.
@prefix
fedora:
<http://fedora.info/definitions/v4/repository#>
.
@prefix
validation:
<urn:validation
#>
.
@prefix
app:
<urn:app
#>
.
validation:
Valid
owl:
equivalentClass
[
app:
Complete
owl:
equivalentClass
[
owl:
intersectionOf
(
[
a
owl:
Restriction
;
owl:
onProperty
skos:
prefLabel
;
...
...
acrepo-services-
validation
/src/test/resources/isBinary.ttl
→
acrepo-services-
inference
/src/test/resources/isBinary.ttl
View file @
1930a4ed
@prefix
owl:
<http://www.w3.org/2002/07/owl#>
.
@prefix
fedora:
<http://fedora.info/definitions/v4/repository#>
.
@prefix
validation:
<urn:validation
#>
.
@prefix
app:
<urn:app
#>
.
validation:
Valid
owl:
equivalentClass
fedora:
Binary
.
app:
Complete
owl:
equivalentClass
fedora:
Binary
.
acrepo-services-
validation
/src/test/resources/isResource.ttl
→
acrepo-services-
inference
/src/test/resources/isResource.ttl
View file @
1930a4ed
@prefix
owl:
<http://www.w3.org/2002/07/owl#>
.
@prefix
fedora:
<http://fedora.info/definitions/v4/repository#>
.
@prefix
validation:
<urn:validation
#>
.
@prefix
app:
<urn:app
#>
.
validation:
Valid
owl:
equivalentClass
fedora:
Resource
.
app:
Complete
owl:
equivalentClass
fedora:
Resource
.
acrepo-services-
validation
/src/test/resources/isResourceSubClass.ttl
→
acrepo-services-
inference
/src/test/resources/isResourceSubClass.ttl
View file @
1930a4ed
@prefix
fedora:
<http://fedora.info/definitions/v4/repository#>
.
@prefix
rdfs:
<http://www.w3.org/2000/01/rdf-schema#>
.
@prefix
validation:
<urn:validation
#>
.
@prefix
app:
<urn:app
#>
.
fedora:
Resource
rdfs:
subClassOf
validation:
Valid
.
fedora:
Resource
rdfs:
subClassOf
app:
Complete
.
acrepo-services-
validation
/src/test/resources/logback-test.xml
→
acrepo-services-
inference
/src/test/resources/logback-test.xml
View file @
1930a4ed
...
...
@@ -7,7 +7,7 @@
</encoder>
</appender>
<logger
name=
"edu.amherst.acdc.services.
validation
"
additivity=
"false"
level=
"INFO"
>
<logger
name=
"edu.amherst.acdc.services.
inference
"
additivity=
"false"
level=
"INFO"
>
<appender-ref
ref=
"STDOUT"
/>
</logger>
<root
additivity=
"false"
level=
"INFO"
>
...
...
acrepo-services-
validation
/src/test/resources/resource.ttl
→
acrepo-services-
inference
/src/test/resources/resource.ttl
View file @
1930a4ed
File moved
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment