001/*
002 * Copyright 2015 DuraSpace, Inc.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.fcrepo.integration.rdf;
017
018import org.junit.Test;
019
020/**
021 * @author cabeer
022 */
023public class OpenAnnotationIT extends AbstractIntegrationRdfIT {
024    @Test
025    public void testOpenAnnotationChoice() {
026        final String s = "@prefix content: <http://www.w3.org/2011/content#> .\n" +
027                "@prefix dc11: <http://purl.org/dc/elements/1.1/> .\n" +
028                "@prefix dcmitype: <http://purl.org/dc/dcmitype/> .\n" +
029                "@prefix openannotation: <http://www.w3.org/ns/oa#> .\n" +
030                "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n" +
031                "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n" +
032                "\n" +
033                "<> a openannotation:Annotation;\n" +
034                "   openannotation:hasBody [\n" +
035                "     a openannotation:Choice;\n" +
036                "     openannotation:default [\n" +
037                "       a content:ContentAsText,\n" +
038                "         dcmitype:Text;\n" +
039                "       dc11:language \"en\";\n" +
040                "       content:chars \"I love this English!\"\n" +
041                "     ];\n" +
042                "     openannotation:item [\n" +
043                "       a content:ContentAsText,\n" +
044                "         dcmitype:Text;\n" +
045                "       dc11:language \"fr\";\n" +
046                "       content:chars \"Je l'aime en Francais!\"\n" +
047                "     ]\n" +
048                "   ];\n" +
049                "   openannotation:hasTarget <http://purl.stanford.edu/kq131cs7229>;\n" +
050                "   openannotation:motivatedBy openannotation:commenting .";
051        createLDPRSAndCheckResponse(getRandomUniqueId(), s);
052    }
053}