Skip to content

Commit

Permalink
updates to support LDP containers
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg McFall committed Dec 16, 2013
1 parent b9894c2 commit d0ce2de
Show file tree
Hide file tree
Showing 43 changed files with 2,085 additions and 315 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
mediaType=application/vnd.ims.lis.v2.lineitemcontainer+json
rdfType=http://purl.imsglobal.org/vocab/lis/v2/outcomes#LineItemContainer
contextURI=http://purl.imsglobal.org/ctx/lis/v2/outcomes/LineItemContainer
contextRef=[LIS, 14 LIC]
title=LineItemContainer in the <code>application/vnd.ims.lis.v2.lineitemcontainer+json</code> format.

status=IMS Working Draft

abstract= \
A LineItemContainer defines the endpoint to which clients \n\
POST new LineItem resources and from which they GET the list of LineItems associated with a \n\
a given learning context. This specification document describes a media type suitable for \n\
the response from a GET request. The response is based on the W3C Linked Data Platform recommendations. \n\


introduction= \
A LineItemContainer defines the endpoint to which clients \n\
POST new LineItem resources and from which they GET the list of LineItems associated with a \n\
a given learning context. This specification document describes a media type suitable for \n\
the response from a GET request.

sampleText=\
<p>The items within a LineItemContainer are paginated in accordance with the W3C Linked Data Platform \n\
recommendations. Figure 1 shows one page of items. It is the responsibility of the server to determine \n\
the maximum number of items that will be returned in each page. In this example, the number of items is \n\
artificially limited to just two items. In a typical, real-world case the number of items per page \n\
will be larger. Notice that the payload gives the URI for the next page. If there is no next page, \n\
the <code>nextPage</code> property will have the value "nil".</p>

idref=\
http://www.w3.org/ns/ldp#nextPage \
http://purl.imsglobal.org/vocab/lis/v2/outcomes#assessmentContext \
http://purl.imsglobal.org/vocab/lis/v2/outcomes#assessedActivity \
http://purl.imsglobal.org/vocab/lis/v2/outcomes#results

Context.includes=\
http://purl.imsglobal.org/vocab/lis/v2/outcomes#lineItem

LineItemContainer.excludes=\
http://www.w3.org/ns/ldp#membershipPredicate

LineItem.excludes=\
http://purl.imsglobal.org/vocab/lis/v2/outcomes#result




38 changes: 38 additions & 0 deletions examples/lti/src/main/resources/rdf/LineItemContainer/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"@context" : "http://purl.imsglobal.org/ctx/lis/v2/outcomes/LineItemContainer",
"@type" : "Page",
"@id" : "http://server.example.com/sections/2923/gradebook/?firstPage",
"nextPage" : "http://server.example.com/sections/2923/gradebook/?p=2",
"pageOf" : {
"@type" : "LineItemContainer",
"membershipSubject" : {
"@id" : "http://server.example.com/resources/Context/51455",
"lineItem" : [
{ "@id" : "http://server.example.com/sections/2923/gradebook/items/1",
"label" : "Chapter 1 Quiz",
"assessmentContext" : "http://server.example.com/sections/2923",
"scoreConstraints" : {
"@type" : "NumericLimits",
"normalMaximum" : 100,
"extraCreditMaximum" : 10,
"totalMaximum" : 110
},
"assessedActivity" : "http://tp.example.com/biology/quiz/1",
"results" : "http://server.example.com/resources/ResultContainer/9157"
},
{ "@id" : "http://server.example.com/sections/2923/gradebook/items/2",
"label" : "Chapter 2 Quiz",
"assessmentContext" : "http://server.example.com/resources/Context/55002",
"scoreConstraints" : {
"@type" : "NumericLimits",
"normalMaximum" : 50,
"extraCreditMaximum" : 5,
"totalMaximum" : 55
},
"assessedActivity" : "http://tp.example.com/biology/quiz/2",
"results" : "http://server.example.com/resources/ResultContainer/52440"
}
]
}
}
}
58 changes: 58 additions & 0 deletions examples/lti/src/main/resources/rdf/ldp.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix bind: <http://purl.org/semantictools/v1/vocab/bind#> .

<http://www.w3.org/ns/ldp#> a owl:Ontology ;
rdfs:label "W3C Linked Data Platform" ;
a bind:TargetNamespace ;
bind:suggestedPrefix "ldp" .

ldp:Container rdf:type owl:Class;
rdfs:subClassOf
[ a owl:Restriction ;
owl:onProperty ldp:membershipPredicate;
owl:minCardinality 1;
rdfs:comment "Indicates which predicate of the container's subject should be used to determine membership in the container."
] ,
[ a owl:Restriction ;
owl:onProperty ldp:membershipSubject;
owl:minCardinality 1;
rdfs:comment "Indicates which resource is the subject for the members of the container."
] ;
rdfs:comment "A container that holds a collection of resources. New resources are added to the container by submitting an HTTP POST request to the container endpoint. " .

ldp:Page rdf:type owl:Class;
rdfs:subClassOf
[ a owl:Restriction ;
owl:onProperty ldp:pageOf;
owl:minCardinality 1;
rdfs:comment "Associates a page with its container."
] ,
[ a owl:Restriction ;
owl:onProperty ldp:nextPage;
owl:minCardinality 1
] ;
rdfs:comment "A resource that represents a limited set of members of a LDP Container." .

ldp:membershipPredicate rdf:type owl:FunctionalProperty ;
rdfs:domain ldp:Container ;
rdfs:range rdf:Property ;
rdfs:comment "Indicates which predicate of the container's subject should be used to determine membership in the container." .

ldp:membershipSubject rdf:type owl:FunctionalProperty ;
rdfs:domain ldp:Container ;
rdfs:range rdfs:Resource ;
rdfs:comment "Indicates which resource is the subject for the members of the container." .

ldp:pageOf rdf:type owl:FunctionalProperty ;
rdfs:domain ldp:Page ;
rdfs:range ldp:Container ;
rdfs:comment "Associates a page with its container." .

ldp:nextPage rdf:type owl:FunctionalProperty ;
rdfs:domain ldp:Page ;
rdfs:range ldp:Page .

26 changes: 26 additions & 0 deletions examples/lti/src/main/resources/rdf/ldp_binding.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix bind: <http://purl.org/semantictools/v1/vocab/bind#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .

ldp:Container rdf:type bind:Addressable .
ldp:Container rdfs:subClassOf
[ rdf:type bind:AssociationQualifier ;
bind:onProperty ldp:membershipPredicate ;
bind:associationType bind:Aggregation
],
[ rdf:type bind:AssociationQualifier ;
bind:onProperty ldp:membershipSubject ;
bind:associationType bind:Aggregation
] .
ldp:Page rdf:type bind:Addressable .
ldp:Page rdfs:subClassOf
[ rdf:type bind:AssociationQualifier ;
bind:onProperty ldp:pageOf ;
bind:inverseAssociationType bind:Composition
],
[ rdf:type bind:AssociationQualifier ;
bind:onProperty ldp:nextPage ;
bind:associationType bind:Aggregation
] .

31 changes: 31 additions & 0 deletions examples/lti/src/main/resources/rdf/liscm.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@prefix liscm: <http://purl.imsglobal.org/vocab/lis/v2/cm#> .
@prefix liso: <http://purl.imsglobal.org/vocab/lis/v2/outcomes#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix bind: <http://purl.org/semantictools/v1/vocab/bind#> .

<http://purl.imsglobal.org/vocab/lis/v2/cm#> a owl:Ontology ;
rdfs:label "LIS Course Management" ;
a bind:TargetNamespace ;
bind:suggestedPrefix "liscm" .

liscm:Context rdf:type owl:Class;
rdfs:subClassOf
[ a owl:Restriction ;
owl:onProperty liso:lineItem;
owl:allValuesFrom liso:LineItem;
rdfs:comment "A LineItem associated with this Context."
] ,
[ a owl:Restriction ;
owl:onProperty liscm:lineItems;
owl:minCardinality 1;
rdfs:comment "The container that holds the collection of LineItem resources for this Context."
] .

liscm:lineItems rdf:type owl:FunctionalProperty ;
rdfs:domain liscm:Context ;
rdfs:range liso:LineItemContainer ;
rdfs:comment "The container that holds the collection of LineItem resources for this Context." .

17 changes: 17 additions & 0 deletions examples/lti/src/main/resources/rdf/liscm_binding.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix bind: <http://purl.org/semantictools/v1/vocab/bind#> .
@prefix liscm: <http://purl.imsglobal.org/vocab/lis/v2/cm#> .
@prefix liso: <http://purl.imsglobal.org/vocab/lis/v2/outcomes#> .

liscm:Context rdf:type bind:Addressable .
liscm:Context rdfs:subClassOf
[ rdf:type bind:AssociationQualifier ;
bind:onProperty liso:lineItem ;
bind:associationType bind:Composition
],
[ rdf:type bind:AssociationQualifier ;
bind:onProperty liscm:lineItems ;
bind:associationType bind:Composition
] .

19 changes: 19 additions & 0 deletions examples/lti/src/main/resources/rdf/rdfs.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix liso: <http://purl.imsglobal.org/vocab/lis/v2/outcomes#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix bind: <http://purl.org/semantictools/v1/vocab/bind#> .

<http://www.w3.org/2000/01/rdf-schema#> a owl:Ontology ;
rdfs:label "rdfs" ;
a bind:TargetNamespace ;
bind:suggestedPrefix "rdfs" .

rdfs:Resource rdf:type owl:Class .

rdfs:label rdf:type rdf:Property ;
rdfs:domain liso:LineItem ;
rdfs:range xsd:normalizedString ;
rdfs:comment "A human-friendly label for this LineItem suitable for display. For example, this label might be used as the heading of a column in a gradebook." .

6 changes: 6 additions & 0 deletions examples/lti/src/main/resources/rdf/rdfs_binding.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix bind: <http://purl.org/semantictools/v1/vocab/bind#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .


6 changes: 1 addition & 5 deletions semantictools-context-renderer/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
<classpathentry kind="var" path="M2_REPO/joda-time/joda-time/2.0/joda-time-2.0.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar" sourcepath="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/semantictools/semantictools-jsonld/1.17/semantictools-jsonld-1.17.jar" sourcepath="M2_REPO/org/semantictools/semantictools-jsonld/1.17/semantictools-jsonld-1.17-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/C:/Users/umcfag1/.m2/repository/org/semantictools/semantictools-jsonld/1.17/semantictools-jsonld-1.17-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/org/semantictools/semantictools-jsonld/1.24/semantictools-jsonld-1.24.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar"/>
<classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.10.0/xercesImpl-2.10.0.jar"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Fri Jul 12 09:08:31 EDT 2013
#Wed Nov 06 07:42:14 PST 2013
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.6
Expand Down
8 changes: 4 additions & 4 deletions semantictools-context-renderer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
</developer>
</developers>

<!--

<distributionManagement>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Nexus Snapshots Repository</name>
<url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>
-->


<properties>
<build.finalName>semantictools-context-renderer</build.finalName>
Expand Down Expand Up @@ -155,7 +155,7 @@
</resources>
<plugins>

<!--

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand All @@ -181,7 +181,7 @@
</execution>
</executions>
</plugin>
-->

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.semantictools.bind;

public class LDP {

public static final String namespace = "http://www.w3.org/ns/ldp#";

public static final String membershipPredicate = "http://www.w3.org/ns/ldp#membershipPredicate";
public static final String membershipSubject = "http://www.w3.org/ns/ldp#membershipSubject";

}
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,16 @@ private TreeNode doGenerateNode(Field field) {
}
}

boolean readOnly =
field.getRdfType().canAsFrame() &&
(field.getRdfType().asFrame().getContainerRestriction() != null);

int maxCardinality = field.getMaxCardinality();
if (contextProperties.getOptionalProperties().contains(uri)) {
maxCardinality = 0;
}

node.setReadOnly(readOnly);
node.setKind(Kind.PROPERTY);
node.setMinCardinality(field.getMinCardinality());
node.setMaxCardinality(maxCardinality);
Expand Down Expand Up @@ -333,9 +338,7 @@ private TreeNode doGenerateNode(Field field) {

}

if (contextProperties.isSimpleName(uri) ||
(frame!=null && frame.hasInstances())
) {
if (contextProperties.isSimpleName(uri)) {
node.setObjectPresentation(ObjectPresentation.SIMPLE_NAME);
}

Expand Down
Loading

0 comments on commit d0ce2de

Please sign in to comment.