Coder Social home page Coder Social logo

cliffordanderson / xquery4humanists Goto Github PK

View Code? Open in Web Editor NEW
46.0 10.0 12.0 168 KB

Exercises for the XQuery Workshops at XQuery at DH2017

Home Page: https://dh2017.adho.org/program/workshops/

XQuery 100.00%
xquery basex xml-database oxygen-xml exist-db

xquery4humanists's Introduction

XQuery4Humanists

We're going to explore some fundamental concepts of XQuery and then try out some applications.

Installation Instructions

You've got several options for an XQuery processor.

BaseX

BaseX is an open source XML database. I recommend downloading the Windows installer if you're using Windows and using Homebrew if you're on a Mac. The installation command is brew install basex.

Note: Installing BaseX may require that you update to Java 7. If so, install the Java Runtime Environment (JRE) and try again.

Screenshot of BaseX GUI

eXist

eXist is another open source XML database. The latest release is 3.4.0. If you are on a Mac, you can also install with Homebrew: brew cask install exist-db. When you run for eXist for the first time, you'll need to set configuration settings. We recommend that you accept the defaults for now. After eXist starts, navigate to eXide, its browser-based query executive engine.

Screenshot of eXide

oXygen XML Editor

If you're using the oXygen XML editor, we're assuming that you're using Saxon PE (professional edition) v. 9.7.0.15 or later and that you've turned on support for XQuery 3.0. Check your settings to make sure we'll all on the same page.

Screenshot of oXygen Settings for XQuery

xquery4humanists's People

Contributors

cliffordanderson avatar joewiz avatar lakonis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xquery4humanists's Issues

Typo

In introduction.md, there's a typo:

There is also an expression called typeswitch that let's you branch on types rather than values.

"let's" should be "lets"

=) Thanks for the lesson!

Question about 01-introduction

Hey Cliff,

I was just giving the material a look over, and had one question: I wasn't quite clear what you're expecting the examples around lines 270-290 to return? Here they are:

let $ids :=
  <identifiers>
    <isbn num="13">978-0133507645</isbn>
    <isbn num="10">0133507645</isbn>
    <isbn num="13">978-0133507645</isbn>
  </identifiers>
where $ids/isbn/@num FIX ME! "13"
return $ids
let $ids :=
  <identifiers>
    <isbn num="13">978-0133507645</isbn>
    <isbn num="10">0133507645</isbn>
    <isbn num="13">978-0133507645</isbn>
  </identifiers>
where some $id in ($ids/isbn/@num) satisfies FIX ME!
return $ids

My guess is that a student would expect that their change would result in a filtered list - only the <isbn num="13"> entries. But nothing the student changes the where expression to would filter out the <isbn num="10"> entries from the results. No matter what, editing only the where clause will only result in the entire <identifiers> element or an empty sequence being returned.

As a result, I wasn't sure what you were trying to illustrate? Sorry if I was misreading anything.

Joe

map(*) cannot be serialized

Working on chapter 05, in the first serialization attempt using fn:serialize(),

Once we've succeeded in generating an XQuery map/array representation of our data, then all we need to generate the JSON representation of this data is to serialize , or write out, the results as JSON. To do this we could use the fn:serialize()

basex (8.6.5) gives me the error : [SENR0001] Items of type map(*) cannot be serialized
Does it really work for you (after correction on line 13, missing :=) ?

"Alternative lookup syntax"

Hi Cliff,

In 03, around line 470, there's this paragraph:

The extra work of finding the size of the array and iterating through its members is actually not necessary when we use the alternative lookup syntax. Can you rewrite this example with the lookup syntax?

I wasn't exactly sure what you meant by "alternative lookup syntax." Did you mean the ? lookup operator? Are you asking the student to write out a more verbose path rather than use map:find()?

Joe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.