Example #1
0
 def setUp(self):
     self.fakegetreffs = lambda x: x
     self.retrieverproto = RetrieverPrototype()
     self.resolver = Resolver(self.retrieverproto)
     self.fakeurn = MyCapytain.common.reference.URN(
         "urn:cts:greekLit:tlg0012.tlg001.perseus-grc1")
     self.faketarget = self.fakeurn
 def setUp(self):
     self.resolver = Resolver(LocalRetriever(path="./tests/test_data/"))
     self.one = (URN("urn:cts:latinLit:phi1294.phi002.perseus-lat2:6.1"),
                 "interface/treebanks/treebank1.xml", "dc:treebank")
     self.two = (URN("urn:cts:latinLit:phi1294.phi002.perseus-lat2:1.5"),
                 "interface/treebanks/treebank2.xml", "dc:treebank")
     self.three = (URN("urn:cts:latinLit:phi1294.phi002.perseus-lat2:6.1"),
                   "interface/images/N0060308_TIFF_145_145.tif", "dc:image")
     self.four = AnnotationResource(
         "interface/researchobject/researchobject.json",
         type_uri="dc:researchobject",
         target=URN("urn:cts:latinLit:phi1294.phi002.perseus-lat2:1.pr.1"),
         resolver=self.resolver)
     self.one_anno = AnnotationResource(self.one[1],
                                        type_uri=self.one[2],
                                        target=self.one[0],
                                        resolver=self.resolver)
     self.two_anno = AnnotationResource(self.two[1],
                                        type_uri=self.two[2],
                                        target=self.two[0],
                                        resolver=self.resolver)
     self.three_anno = AnnotationResource(self.three[1],
                                          type_uri=self.three[2],
                                          target=self.three[0],
                                          resolver=self.resolver)
     self.fourth_anno = AnnotationResource(
         self.three[1],
         type_uri=self.three[2],
         target=("urn:cts:latinLit:phi1294.phi002.perseus-lat2", "1-2"),
         resolver=self.resolver)
     self.app = Flask("app")
     logger = logging.getLogger('my-logger')
     logger.propagate = False
     self.nautilus = CtsCapitainsLocalResolver(
         ["tests/test_data/interface/latinLit"], logger=logger)
     self.nemo = Nemo(app=self.app, resolver=self.nautilus, base_url="")
     self.query = SimpleQuery(
         [self.one, self.two, self.three, self.four],  # List of annotations
         self.resolver)
     self.query.process(self.nemo)
    def setUp(self):
        self.resolver = Resolver(
            RetrieverMock
        )

        self.params_1 = [
            "http://localhost",
            URN("urn:cts:latinLit:phi1294.phi002.perseus-lat2"),
            "http://foo.bar/treebank",
            self.resolver,
            Target,
            "application/xml",
            "treebank"
        ]
        self.params_2 = [
            "http://localhost1",
            {"urn": URN("urn:cts:latinLit:phi1294.phi002.perseus-lat2")},
            "http://foo.bar/treebank1",
            self.resolver,
            WTarget,
            "application/xml1",
            "treebank1"
        ]
Example #4
0
 def setUp(self):
     self.resolver = Resolver(CTSRetriever(resolver=NautilusDummy),
                              HTTPRetriever(),
                              LocalRetriever(path="./tests/test_data"))
Example #5
0
     ("urn:cts:aperire:delver.init.opp-lat1:6.1",
      "http://sosol.perseids.org/sosol/dmm_api/item/TreebankCite/36281",
      "http://data.perseus.org/rdfvocab/treebank"),
     ("urn:cts:aperire:delver.init.opp-lat1:6.2",
      "http://sosol.perseids.org/sosol/dmm_api/item/TreebankCite/36282",
      "http://data.perseus.org/rdfvocab/treebank"),
     ("urn:cts:aperire:delver.init.opp-lat1:7.1",
      "http://sosol.perseids.org/sosol/dmm_api/item/TreebankCite/36283",
      "http://data.perseus.org/rdfvocab/treebank"),
     ("urn:cts:aperire:delver.init.opp-lat1:7.2",
      "http://sosol.perseids.org/sosol/dmm_api/item/TreebankCite/36284",
      "http://data.perseus.org/rdfvocab/treebank"),
     ("urn:cts:aperire:delver.init.opp-lat1:8.1",
      "http://sosol.perseids.org/sosol/dmm_api/item/TreebankCite/36521",
      "http://data.perseus.org/rdfvocab/treebank")],
    resolver=Resolver(HTTPRetriever()))

# We set up Nemo
nemo = Nemo(app=app,
            name="nemo",
            base_url="",
            api_url="/api/cts",
            retriever=nautilus.retriever,
            plugins=[Arethusa(queryinterface=query),
                     AperireUI()],
            chunker={"default": lesson_chunker},
            transform={
                "default":
                resource_filename("aperire_ui",
                                  "data/assets/static/xslt/epidocShort.xsl")
            })