WELCOME BACK TO EDIRECT FOR
PUBMED. TODAY IS PART 2,
EXTRACTING DATA FROM XML. TODAY
I AM HERE WITH PETE SEIBERT AND
MIKE DAVIDSON. THIS IS THE
SECOND OF FIVE SESSIONS IN THE
EDIRECT FOR PUBMED SERIES. WE
TALKED ABOUT USING EDIRECT
COMMANDS TO SEARCH FOR AND
RETRIEVER PUBMED RECORDS IN A
VARIETY OF FORMATS, INCLUDING
XML. TODAY WE WILL TALK ACT THE
EXTRACT COMMAND, WHICH LETS YOU
EXTRACT DATA ELEMENTS AND
ARRANGE THEM IN A CUSTOM TABULAR
FORMAT. EXTRACT IS A PRETTY BIG
TOPIC, SO WE'LL SPEND THE MOST
OF NEXT THREE CLASSES DISCUSSING
THE ASPECTS OF IT, BEFORE WE
FINISH UP WITH A BROADER
DISCUSSION OF EDIRECT. WE'LL
START WITH A RECAP OF LAST
SESSION AND ANSWER ANY QUESTIONS
THAT YOU HAVE ABOUT THE
HOMEWORK. FEEL FREE TO STICK
THOSE QUESTIONS IN THE CHAT BOX
NOW. THEN WE ARE GOING TO DO A
BIT OF A REFRESHER COURSE ON THE
BASICS OF THE XML, TO FIGURE OUT
WHICH DATA WE WANT TO EXTRACT
FROM THAT XML. WE WILL TALK ACT
CREATING BASIC TABLES AND WE'LL
FINISH UP WITH A FEW COMMANDS
THAT CAN HELP YOU CLEAN UP YOUR
OUTPUT. TODAY WILL BE KIND OF
CONTENT-HEAVY AT THE BEGINNING,
THEN WE'D HEAD INTO EXAMPLES A
LITTLE LATER ON TODAY. TO
RECAP, SO ESEARCH, IT SEARCHES
THE DATABASE. EFETCH, I BELIEVE
ALLAN SUGGESTED LAST WEEK OR
FOND, BRING YOUR SLIPPERS AND
PAPER. UNFORTUNATELY, IT DOES
NOT. EFETCH RETRIEVERS RECORDS
FROM DATABASE IN A VARIETY OF
FORMATS. THAT PIPE CHARACTER,
PIPES RESULTS FROM ONE COMMAND
TO THE NEXT. TIPS FOR THE
CYGWIN USERS OUT THERE, COPY IS
CONTROL PLUS INSERT, PASTE IS
SHIFT PLUS INSERT. THOSE ARE
ADJUSTMENT IN YOUR OPTIONS.
USING CONTROL V WILL NOT WORK
VERY WELL HERE. TIPS FOR ALL
USERS, REGARDLESS OF WHAT
TERMINAL YOU ARE USING, CONTROL
C WILL CANCEL. A GREAT WAY TO
GET OUT AFTER A MISTAKE QUICKLY
OR YOU HAVE A LONG-RUN SCRIPT
AND YOU HAVE TO IDEA WHY IT IS
RUNNING SO LONG, CONTROL C. YOU
CAN USE YOUR UP AND DOWN ARROWS
TO CYCLE THROUGH HISTORY. YOU
WILL SEE ME USE THIS ALL THE
TIME TODAY. YOU WILL SEE ME
USING THE CLEAR COMMAND, WHICH
WILL CLEAR YOUR SCREEN, BUT NOT
ACTUALLY CLEAR YOUR HISTORY. SO
QUESTIONS FROM LAST CLASS.
THERE WAS ONE QUESTION AT THE
VERY END OF CLASS LAST TIME WE
DIDN'T QUITE GET TO. THE
QUESTION WAS CAN YOU SEARCH--
MESH TERMS WITH A SLASH IN
BETWEEN THEM, SO VACCINE, SLASH,
ADVERSE EFFECTS, WILL THAT WORK
IN EDIRECT? YES. BACKSLASH
WILL NOT AFFECT ANYTHING. YOU
CAN TREAT IT LIKE YOU WOULD IN A
NORM PUBMED SEARCH. ALL RIGHT.
ARE THERE ANY QUESTIONS? LOOKS
LIKE WE ARE DOING PRETTY WELL.
LET'S CONTINUE ON. ANOTHER
THING WE TALKED ABOUT LAST CLASS
WAS THE THEME FOR THIS COURSE,
GETTING EXACTLY THE PUBMED DATA
YOU NEED AND ONLY THE DATA YOU
NEED IN THE EXACT FORMAT YOU
NEED IT IN. WE TALKED ABOUT HOW
TO GET DATA FROM PUBMED BY USING
ESEARCH AND EFETCH TO RETRIEVE,
BUT WE PROMISE THE POINT OF
EDIRECT AND REALLY OF EUTILITIES
IN GENERAL IS TO CUSTOMIZE YOUR
OUTPUT AND SELECT ONLY THE DATA
ELEMENTS YOU NEED FROM THE XML.
WE NEED TO MAKE SURE EVERYONE IS
ON THE SAME PAGE AS FAR AS THE
BASIC STRUCTURE AND SYNTAX OF
XML GO. SO HOPEFULLY IT WILL BE
OLD HAT FOR MOST OF YOU, BUT
JUST WANT TO REFRESH YOUR
MEMORY. XML OR EXTENSIBLE
MARKUP LANGUAGE IS USED FOR
STORING AND TRANSPORTING THE
DATA. XML IS DESIGNED AND
STRUCTURED TO BE READ AND
CRUISED BY COMPUTERS, BUT
FORTUNATELY FOR US ALSO ABLE TO
BE READ AND UNDERSTOOD BY
HUMANS. THE XML DOCUMENTS ARE
COMPOSED OF ELEMENTS. YOU WILL
SEE LOT OF THOSE TODAY. THIS IS
AN XML ELEMENT. IT'S GOT AN
OPEN TAG AND A CLOSED TAG WITH
THE NAME OF THE ELEMENT. IN
THIS CASE, YEAR. IT ALSO
CONTAINS SOME DATA. HERE, IT'S
2015. SOME XML ELEMENTS ALSO
HAVE ATTRIBUTES, WHICH PROVIDE
MORE INFORMATION. ATTRIBUTES
ARE INSIDE THE OPEN TAG AND HAVE
NAME AND VALUE. IN THIS EXAMPLE
CASE, THE ATTRIBUTE NAME IS
STATUS AND THE ATTRIBUTE VALUE
IS MEDLINE. HERE WE CAN SEE THE
ELEMENT IS MEDLINE CITATION.
HERE WE HAVE A FRAGMENT OF AN
XML DOCUMENT. THIS IS OUR
EXAMPLE BASED LOOSELY ON A
PUBMED XML DOCUMENT. WE TOOK
OUT A COUPLE OF THE REQUIRED
ELEMENTS, JUST SO WE COULD FIT
IT ALL ON ONE POWERPOINT SLIDE.
THE FIRST THING WE SEE HERE IS
THE OPEN TAG OF THE ELEMENT
PUBMED ARTICLE SET. THE CLOSED
TAG IS ALL THE WAY DOWN AT THE
BOTTOM OF THE SCREEN. THE REST
OF THE DOCUMENT IS CONTAINED
WITHIN THIS ELEMENT. THIS IS
AN-PARENT CONCEPT. IT CONTAINS
TEXT, LIKE OUR PREVIOUS EXAMPLE.
XML ELEMENTS CAN ALSO CONTAIN
OTHER ELEMENTS. IT CREATES A
STRUCTURE WHERE CHILD ELEMENTS
ARE NESTED INSIDE PARENT
ELEMENT. THE PUBMED ARTICLE SET
HAS A CHILD ELEMENT, PUBMED
ARTICLE. AND THEN PUBMED
ARTICLE HAS ITS OWN CHILDREN.
HERE YOU CAN SEE PMID, DATE
CREATED, JOURNAL AND ID.
SOME OF THE CHILD ELEMENTS HAVE
TEXT, LIKE ARTICLE TITLE. YOU
CAN SEE THAT HERE. OTHERS
CONTAIN CHILDREN OF THEIR OWN,
LIKE DATE CREATED. YOU CAN SEE
THE CHILDREN OF THIS ARE YEAR,
MONTH AND DAY. WE ALSO HAVE FEW
ELEMENTS WITH ATTRIBUTES, SO
ISSN HAS AN ISSN TYPE ATTRIBUTE,
WITH THE VALUE ELECTRONIC.
ELOCATION ID HAS TWO DIFFERENT
ATTRIBUTES. THIS IS ANOTHER
MOCK-UP OF A DOCUMENT. THIS
FOLLOWS THE STRUCTURE YOU WILL
SEE A LOT TODAY, WHICH IS THE
STRUCTURE YOU GET WHEN YOU USE
EFETCH TO GET RECORDS. THE
WHOLE DOCUMENT IS WRAPPED IN
THIS PUBMED ARTICLE SET ELEMENT,
WHICH CONTAINS SEVERAL PUBMED
ARTICLE CHILD ELEMENTS. EACH
PUBMED ARTICLE ELEMENT CONTAINS
ALL THE INFORMATION FOR A SINGLE
PUBMED RECORD. THIS ALSO
DEMONSTRATES ANOTHER IMPORTANT
FACT ACT XML ELEMENTS. SOME OF
THESE ELEMENTS CAN BE REPEATED
IN THE SAME DOCUMENT. YOU WILL
SEE THEY WHEN YOU FETCH MULTIPLE
RECORDS, BUT ALSO WITHIN A
SINGLE PUBMED RECORD, YOU WILL
SEE ELEMENTS LIKE AUTHOR AND
MESH HEADING, SINCE AN ARTICLE
CAN HAVE MULTIPLE ARTICLES OR
MESH HEADINGS. CONVERTING THIS
INTO A TABLE CAN GET KIND OF
TRICKY. NEED TO GET THE RIGHT
DATA AND ARRANGE IT IN A WAY
THAT MAKES LOGICAL SENSE.
BEFORE THAT, ARE THERE ANY
QUESTIONS? GETTING INFORMATION
IN AN EASY TO USE FORM IS WHY WE
WANT TO USE EXTRACT. EXTRACT IS
A BIG PART OF WHAT'S USEFUL
ABOUT EDIRECT DETECT. IT
EXTRACTS SPECIFIC ELEMENTS AND
ARRANGED THEM IN A CUSTOM
TABULAR FORMAT. LIKE MOST UNIX
COMMANDS, YOU CONTROL THE
DETAILS OF HOW EXTRACT WORKS BY
PROVIDING ARGUMENTS. WHICH
ARGUMENTS YOU PROVIDE ARE GOING
TO DETERMINE WHAT THAT FORMAT
LOOKS LIKE. WHILE EXTRACT IS A
PART OF ME DIRECT, IT IS NOT AN
EUTILITIES COMMAND. THERE'S NO
E IN FRONT OF IT. THAT'S ABOUT
AS FAR AS I CAN GO IN THIS
COMEDY ROUTINE. SORRY.
IT WORKS ON XML DATA YOU HAVE
ALREADY BROUGHT DOWN TO YOUR
COMPUTER. IT IS AN IMPORTANT
TOOL FOR PROCESSING DATA YOU GET
FROM OTHER EDIRECT COMMANDS,
WHICH DO CONTACT THE SERVER. SO
ONE OF THE ADVANTAGES OF THE
XTRACT, IT CAN WORK ON ANY XML.
FOR MOST OF OUR EXAMPLES, OUR
XML WILL BE THE OUTPUT OF AN
EFETCH WE PIPED INTO XTRACT. TO
DO THAT, WE HAVE TO MAKE SURE WE
USE THE FORMAT XML ARGUMENT.
BUT YOU CAN ALSO USE XTRACT'S
INPUT ARGUMENT TO SPECIFY AN XML
FILE ALREADY ON A COMPUTER N.
THIS EXAMPLE, YOU CAN SEE WE ARE
BRINGING IN FILE.XML AND WE WILL
EXTRACT FROM THAT. THERE ARE A
LARGE NUMBER OF ELEMENTS IN
PUBMED. YOU WILL PROBABLY BE
ABLE TO DETERMINE WHICH ELEMENTS
REFER TO HAVE INFORMATION
DISPLAYED IN THE WEB VERSION, WE
ALSO HAVE DOCUMENTATION TO HELP
WITH THAT. I'M GOING TO JUMP
OUT OF POWERPOINT. THIS IS
GOING TO HAPPEN A BUNCH TODAY.
WE WILL GO BACK AND FORTH
BETWEEN POWERPOINT AND PUBMED,
SO JUST TRYING TO GIVE YOU A
WARNING. IF I JUMP OUT OF HERE
AND HEAD TO MY WEB BROWSER, THIS
IS OUR DOCUMENTATION. WE HAVE
THE LINK THAT SHOULD BE PUT IN
THE CHAT BOX IN JUST A MINUTE,
AND IT'S ALSO IN OUR POWERPOINT
THAT IS LINKED ON OUR COURSE
MATERIALS PAGE. THIS
DOCUMENTATION LISTS THE
DIFFERENT ELEMENTS YOU WILL FIND
IN PUBMED, AS WELL AS THEIR
ATTRIBUTES. THE FIRST PAGE YOU
SEE LISTS THE ELEMENTS IN THE
ORDER YOU WOULD SEE THEM IN THE
PUBMED DTD. GO DOWN UNDER THE
FIRST HEADING AND CLICK
ALPHABETICAL LIST. I FIND THIS
PAGE TO BE THE MOST HELPFUL, IF
I'M LOOKING AT AN XML RECORD AND
WANT TO KNOW WHAT AN ELEMENT OR
ATTRIBUTE IS REFERRING TO. WHEN
WE ARE WORKING WITH EXTRACT, WE
ARE GOING TO BE DIRECTING THE
COMMAND TO SELECT SPECIFIC
ELEMENTS AND ATTRIBUTES FROM
SPECIFIC PARTS OF THE XML
RECORD. TO HELP US CHOOSE THE
RIGHT ELEMENTS, WE HAVE TO
UNDERSTAND HOW THE XML IS
STRUCTURED. THE EASIEST WAY TO
DO THIS IS TO HAVE SOME OF THE
XML OF SOME SAMPLE RECORDS OPEN
IN A WINDOW THAT WE CAN CONSULT.
I WILL JUMP BACK OUT OF HERE
AGAIN. SO I HEAD THE PUBMED,
GOT A COUPLE IN THE HANDOUT.
ENTER THESE. I WILL RUN MY
PUBMED SEARCH. I GET MY THREE
RESULTS HERE. AND THEN FROM
HERE, I AM GOING TO GO UP TO THE
FORMAT MENU AND CHANGE IT FROM
SUMMARY, WHICH IS THE DEFAULT,
TO XML. CLICK THAT, GO TO XML.
THIS WILL LET YOW LOOK AT THE
PUBMED RECORDS IN THE EXACT SAME
XML FORMAT THAT UP FETCH WILL
RETRIEVE IF YOU USE THAT FORMAT
XML ARGUMENT. WE KEEP THIS OPEN
AND REFER BACK TO IT LATER, SO
WE CAN FIGURE OUT WHERE THE DATA
WE ARE LOOKING FOR IS WITHIN
THIS XML STRUCTURE. YOU ARE
GOING TO WANT TO DO A LOT OF
TESTING AND REFINING OF YOUR
XTRACT COMMANDS. IN ADDITION TO
LOOKING AT EXAMPLE XML, IT IS
HELPFUL TO GET A SMALL SET OF
PUBMED RECORDS IN XML YOU CAN
USE TO TEST YOUR XTRACT
STATEMENTS. IDEALLY, YOU WANT A
HANDFUL OF RECORDS
REPRESENTATIVE OF THE KIND OF
RECORDS YOU WILL BE EXTRACTING
FROM FOR REAL, SO YOU WANT TO
MAKE SURE THEY INCLUDE THE SAME
KINDS OF DATA AS YOUR LIVE DATA
SET. IF YOU ARE LOOKING TO
EXTRACT FUNDING INFORMATION, YOU
WANT TEST RECORDS THAT HAVE
FUNDING INFORMATION ON THEM.
YOU WANT TO MAKE SURE YOUR
XTRACT IS WORKING CORRECTLY. AS
WE MENTIONED, THERE ARE A LOT OF
WAYS TO GET XML INTO AN EXTRACT.
IN ORDER TO MAKE SURE YOU CAN
EASILY RECREATE MY EXAMPLES, I
AM GOING TO BE USING A COMMAND
TODAY TO RETRIEVE THE SAMPLE
DATA AND TYPING THAT INTO
XTRACT. THAT IS ON THE SCREEN,
IT IS IN THE HANDOUT, AND WE'LL
USE THIS EFETCH FOR ALMOST EVERY
SINGLE EXAMPLE TODAY. LET'S
JUMP INTO CYGWIN AND SEE WHAT IT
LOOKS LIKE. I HAVE MY TERMINAL
OPEN. UP FETCH, WE ARE USING
PMID, DATABASE PUBMED. I WILL
ADD IN MY ID ARGUMENT, PASTE IN
MY THREE PMIDS I USED IN PUBMED,
SPECIFY I WANT MY FORMAT TO BE
XML. HIT ENTER TO LET THAT RUN,
AND NOW YOU CAN SEE WE'VE GOT
THE SAME XML WE SAW IN PUBMED.
WE HAVE SO MUCH TEXT HERE AND WE
ONLY WANT TO SEE JUST A SMALL
PORTION OF THIS, SO THIS IS
WHERE XTRACT REALLY COMES IN
HANDY. BECAUSE X TRACT IS SO
POWERFUL AND AS SO MANY OPTIONS,
IT CAN BE A LITTLE OVERWHELMING.
WE WILL START WITH A SIMPLE
EXAMPLE. WE HAVE A SET OF
PUBMED RECORDS IN XML. WE DID
AN EXAMPLE. SO NOW WE WANT A
TABULAR LIST WITH PMID, THE
TITLE ABBREVIATION AND THE
ARTICLE TITLE. BASIC
INFORMATION, RIGHT? HOWEVER,
EVEN THE STANDARD CSD FILE YOU
COULD DOWNLOAD FROM PUBMED CAN'T
REALLY DO THIS. YOU WOULD HAVE
TO DIG THAT OUT OF THE DETAILS
FIELD. YOU COULD DO THAT FOR
ONE OR TWO. MORE THAN THAT CAN
GET AT LITTLE REPETITIVE AND NOT
EXACTLY THE BEST WAY TO DO IT,
SO THIS IS OUR GOAL TODAY.
LET'S FIGURE OUT HOW WE DO THIS.
WE WANT TO MAKE A TABLE, BUT
FIRST WE NEED TO PLAN OUT WHAT
OUR TABLE'S GOING TO LOOK LIKE.
THIS IS OUR SAMPLE TABLE, AND
THE FIRST THING WE WANT TO
CONSIDER IS WHAT'S GOING TO
CONNECT THE DATA IN EACH ROW.
SO SEEMS OBVIOUS, BUT IF THE
DATA IN EACH ROW ISN'T RELATED,
THE TABLE ISN'T GOING TO TELL US
MUCH. THE CONNECTION IS THAT
ALL THE DATA IN A ROW IS FROM
THE SAME PUBMED RECORD. THAT'S
OUR RELATIONSHIP. THEN WE NEED
TO FIGURE OUT HOW MANY ROWS WE
NEED. WE WANT AS MANY ROWS AS
WE HAVE PUBMED RECORDS IN OUR
XML. HOW MANY COLUMNS? THIS IS
ALSO SOMETHING WE'LL NEED TO
ADDRESS. THEN WHAT DATA IS IN
EACH COLUMN. SO LIKE ALL
EDIRECT COMMANDS, WE SPECIFY
THESE BY CAREFULLY CHOOSING OUR
ARGUMENTS. WE DETERMINE WHAT
CONNECTS OUR DATA BY USING THE
PATTERN ARGUMENT. WE SPECIFY AN
XML ELEMENT FOR THE PATTERN
ARGUMENT AND ALL OF THE DATA IN
A SINGLE ROW IS GOING TO COME
FROM THE DESCENDANT. SO THE
CHILDREN ELEMENTS, OF A SINGLE
OCCURRENCE OF THAT PATTERN
ELEMENT. XTRACT WILL SCAN THE
DOCUMENT YOU INPUT UNTIL IT
FINDS AN OCCURRENCE OF THAT
PATTERN. ONCE IT FIND THAT, IT
WILL CREATE A NEW ROW. SO
AGAIN, THIS IS A DUMMY XML
DOCUMENT, SAME AS BEFORE, SO WE
SPECIFIED THAT OUR PATTERN IS
GOING TO BE PUBMED ARTICLE. SO
XTRACT IS GOING TO SCAN THROUGH
UNTIL IT FINDS THE FIRST
OCCURRENCE OF THAT ELEMENT.
ONCE IT DOES, IT IS GOING TO
CREATE A FEW ROW IN OUR OUTPUT
TABLE. ALL THE DATA IN A ROW
WILL COME FROM WITHIN THAT
PATTERN, WITHIN THIS ONE PUBMED
ARTICLE. ONCE XTRACT REACHES
THE END OF THE PATTERN, IT WILL
LOOK FOR THE NEXT OCCURRENCE OF
THAT PATTERN AND CREATE ANOTHER
ROW. ALL THE DATA IN THAT
SECOND ROW WILL COME FROM WITHIN
THAT SECOND PATTERN, AND SO ON
AND SO FORTH, UNTIL WE HAVE
REACHED THE END OF THE DOCUMENT
AND CAN FIND NO MORE OCCURRENCES
OF THE PATTERN. THEN WE ARE
GOING TO STOP. SO THIS ALSO
ANSWERS OUR SECOND QUESTION, HOW
MANY ROWS. WE WILL HAVE ONE ROW
PER OCCURRENCE OF THE PATTERN IN
THE XML INPUT. IF OUR PATTERN
IS PUBMED ARTICLE, OUR EXTRACT
COMMAND WILL CREATE AS MANY ROWS
AS THERE ARE RECORDS IN YOUR XML
DOCUMENT. THIS BRINGS UP AN
INTERESTING QUESTION. YOU WOULD
THINK WELL, WOULDN'T BY PATTERN
ALWAYS BE A PUBMED ARTICLE,
SINCE THAT WILL MAKE SURE ALL
THE DATA IN A SINGLE ROW COMES
FROM THE SAME PUBMED RECORD?
WELL, MOST OF THE TIME, THE
ANSWER IS YES. THIS IS WHAT
WILL LET YOU TABULATE PUBMED
RECORD AND ANALYZE TRENDS.
HOWEVER, YOU CAN ALSO CHANGE THE
PATTERN TO SEE DIFFERENT TYPES
OF RELATIONSHIPS, SO IF YOU ARE
LOOKING AT AUTHOR INFORMATION OR
GRANT DATA, YOU MAY WANT TO USE
AUTHOR OR GRANT ELEMENTS YOUR
PATTERN. WE WILL SEE AN EXAMPLE
OF THIS LATER IN CLASS. THAT
COVERS YOUR ROWS. LET'S TALK
ABOUT CREATING SOME COLUMNS NOW.
YOU DO THAT USING A DIFFERENT
ARGUMENT ELEMENT. YOU SPECIFY
ONE OR MORE XML ELEMENTS-- XML
ELEMENTS OR ATTRIBUTES IN THE
ELEMENT ARGUMENT. EACH ELEMENT
OR ATTRIBUTE, YOU SPECIFY
CREATES A NEW COLUMN. HOW MANY
ROWS-- HOW MANY ELEMENTS OR
ATTRIBUTES YOU SPECIFY
DETERMINES THE NUMBER OF
COLUMNS. WELL, MOST OF THE
TIME. LIKE ANY RULES, THERE ARE
EXCEPTIONS TO THIS, BUT FOR NOW,
WE WILL ASSUME THESE THINGS ARE
ALL TRUE. IF WE GO BACK TO OUR
PATTERN, REMEMBER ALL THE DATA
IN A ROW IS GOING TO COME FROM
WITHIN THAT SAME PATTERN. X
TRACT LOOKS INSIDE THE PATTERN
FOR THE ELEMENT AND ATTRIBUTES
YOU SPECIFIED IN THE ELEMENT
ARGUMENT. THE VALUE OF EACH
OCCURRENCE OF YOUR FIRST ELEMENT
GOES INTO THE FIRST COLUMN, THEN
XTRACT WILL MOVE ON TO THE
SECOND COLUMN, PUT THE VALUE OF
EACH OCCURRENCE OF THE SECOND
ELEMENT IN THE SECOND COLUMN,
AND SO ON AND SO FORTH. HERE'S
WHAT THAT LOOKS LIKE. WE HAVE
THE SAME DUMMY XML, STILL USING
THAT PATTERN PUBMED ARTICLE. AT
THE TOP, YOU CAN SEE THE
ELEMENTS WE ARE LOOKING FOR.
XTRACT WILL FIND OUR FIRST
PATTERN, THEN LOOK WITHIN THAT
PATTERN TO FIND THE FIRST
ELEMENT IN OUR ELEMENT ARGUMENT,
WHICH IS PMID. IT FINDS A PMID
ELEMENT AND PUTS THE CONTENTS
INTO THE FIRST COLUMN. IT IS
GOING TO FIND THE YEAR ELEMENT,
AND PUT THE CONTENT INTO THE
SECOND COLUMN. IT IS GOING TO
FIND THE ARTICLE FILL ELEMENT,
THE LAST ONE, AND PUTS THE
CONTENTS INTO THAT THIRD COLUMN.
THERE ARE NO MORE COLUMNS AND IT
IS FREE TO THE END OF THE
PATTERN, SO WE'LL MOVE ON TO THE
SECOND PUBMED ARTICLE, CREATE A
NEW ROW AND REPEAT THE PROCESS,
LOOKING FOR THE PMID, YEAR AND
THE ARTICLE TITLE. SO AGAIN,
THIS PROCESS IS GOING TO REPEAT
UNTIL WE HAVE RUN OUT OF
PATTERNS HERE. SO THAT SEEMS TO
BE ENOUGH WALK-THROUGH FOR NOW.
SO TO SEE WHAT THIS LOOKS LIKE
IN PRACTICE. YOU HAVE SEEN A
LIT SNEAK PEEK OF THE XTRACT
USES, BUT THIS IS A BASIC
COMMAND. OUR XTRACT COMMAND
HERE AS A PATTERN OF PUBMED
ARTICLE AND ELEMENT OF ARTICLE
TITLE.
LET'S HOP INTO CYGWIN AND LOOK
AT THIS AS A DEMO. FIRST I AM
GOING TO CLEAR MY SCREEN. WE
DON'T NEED TO SEE ALL THIS XML
HERE. I AM GOING TO USE THE
SAME EFETCH AS BEFORE F. I WILL
USE MY UP ARROW TO GET TO THAT
EFETCH. I WILL TYPE THAT USING
THE PIPE CHARACTER, MOVE INTO
XTRACT. I USED THE SLASH TO GET
IT ONTO ANOTHER LINE TO MAKE IT
PRETTY AND FIT NICER ON YOUR
SCREEN. I WILL USE MY XTRACT.
THEN I SAID I WANTED MY PATTERN
TO BE PUBMED ARTICLE. SO ONE
THING TO WATCH OUT FOR HERE,
ESPECIALLY WITH THE WORD PUBMED,
IN PUBMED ARTICLES, THE M IS
LOWER CASE, SO WATCH OUT FOR
YOUR CAPITALS IN XTRACT AND
EDIRECT IN GENERAL, BECAUSE GETS
A LITTLE FUSSY WITH THOSE. THEN
WE SAID OUR ELEMENT WAS GOING TO
BE ARTICLE TITLE. SO WE TYPE IN
OUR COMMAND AND HOPEFULLY WE
SHOULD GET ONE ROW PER ARTICLE,
WITH A SINGLE COLUMN THAT
DISPLAYS THE ARTICLE TITLE. AS
WE CAN SEE, THAT'S EXACTLY WHAT
WE GOT. LOOKS A LITTLE
DIFFERENT, BECAUSE THE FIRST
ARTICLE TITLE IS SO LONG THAT
IT'S WRAPPED, BUT THAT'S WHAT WE
HAVE. SO THAT'S REALLY THE
BASICS OF XTRACT. WE KEEP
TALKING ABOUT HOW XTRACT WILL
GIVE US THIS TABULAR OUTPUT AND
SAY THAT'S WHAT WE WANT, BUT
THIS REALLY LOOKS LIKE A LIST.
WE WANT TO FIGURE OUT HOW TO GET
MULTIPLE COLUMNS. TO GET THESE
MULTIPLE COLUMNS, WE CAN SPECIFY
MORE THAN ONE ELEMENT IN OUR
ELEMENT ARGUMENT. WE DO
SEPARATE THEM WITH SPACES AND WE
DON'T NEED TO REPEAT THE ELEMENT
ARGUMENT. HERE YOU CAN SEE IN
OUR EXAMPLE, WE HAVE TWO
ELEMENTS, AGENCY AND GRANT ID.
THAT IS GOING TO CREATE TWO
COLUMNS AND THE ONE WILL LIST
THAT AGENCY, THEN THE OTHER WILL
LIST THE GRANT ID, WHATEVER THE
PULLED OUT OF THAT XTRACT.
BEFORE WE START OUR FIRST
EXERCISE, ARE THERE ANY
QUESTIONS ABOUT THIS? DOESN'T
LOOK LIKE IT.
LET'S CONTINUE. FOR OUR FIRST
EXERCISE, WE ARE LOOKING FOR YOU
TO WRITE AN XTRACT COMMAND THAT
IS GOING TO CREATE A TABLE WITH
ONE ROW PER PUBMED ARTICLE. WE
WANT EACH ROW TO HAVE TWO
COLUMNS, VOLUME AND ISSUE
NUMBER. SO WE WANT YOU TO TEST
IT, THEN GIVE ME A GREEN CHECK
MARK USING THAT PARTICIPANTS
PANEL, ONCE YOU THINK YOU'VE GOT
IT. SO WE'LL ALSO GIVE YOU A
HINT OR TWO IN THE CHAT BOX, AS
YOU ARE WORKING THROUGH THIS.
WE HAVE THE SAME EFETCH WE
DEMOED. THAT'S WITH WE WILL USE
AS OUR INPUT. I GIVE YOU A
COUPLE MINUTES TO WORK THROUGH
THIS.
ALRIGHT, SO LET'S
START WORKING THROUGH THAT
EXAMPLE. FIRST I AM GOING TO
CLEAR MY SCREEN, JUST SO WE CAN
GET EVERYTHING ALL NICE AND
CLEAR AT THE BEGINNING HERE. WE
SAID WE ARE GOING TO USE THAT
EFETCH AS OUR INPUT. I WILL USE
MY UP ARROW TO GET BACK TO THAT.
TOLD YOU YOU WOULD SEE THIS A
LOT TODAY. PIPE THAT INTO YOUR
XTRACT. WE SIDE WE WANTED ONE
ROW PER PUBMED ARTICLE, SO OUR
PATTERN AS PUBMED ARTICLE. OH,
WATCH THE SPELLING. SOMETHING I
NEED TO WORK ON. PUBMED
ARTICLE, THEN WE WANTED TO HAVE
TWO COLUMNS. SO THOSE ARE--
THAT MEANS WE NEED TO LOOK AT
OUR ELEMENT ARGUE. AND WE SAID
WE WANTED TO GET VOLUME AND
ISSUE NUMBER, SO IN OUR HINT, OR
IF YOU LOOKED AT THE XML, THOSE
VALUES ARE VOLUME AND ISSUE.
GOING-- THIS IS OUR SOLUTION.
I WILL HIT ENTER AND WE SHOULD
GET INTO COLUMNS. WE HAVE ONE
COLUMN WITH OUR VOLUME AND ONE
MORE ISSUE FOR THESE THREE
PUBMED CITATIONS. WE DO ALSO
HAVE-- OH, NO. NANCY, TRY
RUNNING THE SOLUTION PETE STUCK
IN THE CHAT BOX. THE SOLUTIONS
ARE ALSO DOWN AT THE VERY BOTTOM
OF YOUR HANDOUT, IF YOU DO GET
STUCK, SO HOPEFULLY THAT WILL
HELP WITH THAT. SO THIS IS A
PRETTY BASIC SOLUTION TO A BASIC
QUESTION, BUT DEPENDING ON WHAT
TYPE OF RECORD WE'RE WORKING
WITH AND WHAT ELEMENTS WE WANT
TO EXTRACT, WE COULD GET INTO
TROUBLE. I WILL SAY IF YOU ARE
STILL WORKING ON THAT LAST
EXERCISE, I ASK YOU TO PUT THAT
ASIDE FOR THE MOMENT, BECAUSE I
WANT YOU TO SEE THIS NEXT
EXAMPLE. I AM GOING TO RUN A
NEW XTRACT ON A SINGLE PMID.
THIS IS THE ONE TIME TODAY WE
WILL USE A DIFFERENCE EFETCH.
JUST WANT TO WARN YOU. WANTED
TO MAKE EVERYONE AWARE OF THAT.
I AM GOING TO EFETCH, GOING TO
STICK WITH PUBMED AS OUR
DATABASE, PUT IN MY PMID,
27101380. PETE SHOULD BE
PUTTING THAT IN THE CHAT BOX.
IT IS ALSO IN YOUR HANDOUT AS
WELL. THEN WE WANT TO GET THAT
IN OUR-- WHAT WE WANT TO DO IS
WE WANT TO LOOK TO SEE THE PMID
AND THE PUBLICATION YEAR FOR THE
THIS ONE CITATION. SO WE'LL ADD
IN OUR FORMAT XML. YOU
IMMEDIATE THE FORMAT XML TO GET
INTO THE XTRACT. THEN I WILL
TYPE IT CORRECTLY, ADD IN MY
PATTERN PUBMED ARTICLE. THEN WE
WANT JUST THE PMID AND THE YEAR.
SO GOING TO PUTS IN PMID AND
YEAR. SEEMS PRETTY SIMPLE,
RIGHT? I'M GUESSING WE'RE GOING
TO GET THE SINGLE PMID AND
SINGLE YEAR, RIGHT? WELL, THAT
IS CLEARLY NOT WHAT JUST
HAPPENED. WE HAVE A LOT OF
PROBLEMS HERE. EVEN THOUGH WE
ONLY HAVE ONE PMID WE ARE
EXTRACTING FROM, WE HAVE WAY
MORE DATA THAN THAT. LET'S LOOK
AT THIS PMID IN THIS PMID'S XML.
SO WE JUMP TO PUBMED, THEN I AM
GOING TO SEARCH FOR THAT ONE
PMID. I'M GOING TO CHANGE THIS
TO XML. HERE'S OUR XML. YOU
CAN SEE WE HAVE THE PMID WE
WANTED, WHAT WE EXPECTED. YOU
CAN ALSO SEE WE HAVE A YEAR HERE
AND WE HAVE ANOTHER YEAR UNDER
DATE REVISED, THEN WE HAVE YET
ANOTHER YEAR HERE UNDER THE PUB
DATE, SO THAT'S ALREADY QUITE
FEW YEARS AND MORE THAN WE ARE
EXPECTING. IF WE WANT TO FIND
ALL OUR OTHER PMIDS, SO I CAN DO
A FIND, AND SCROLL THROUGH, SEE
WHERE IT'S HIGHLIGHTED IT FOR
ME. YOU CAN SEE WE'VE GOT THOSE
OTHER PMIDS POPPING UP IN OUR
XTRACT. THIS IS PRETTY COMMON,
BECAUSE THESE ARE HELPING TO
LINK THIS ONE ARTICLE TO OTHER
ARTICLES. SINCE YOU ARE OFTEN
USING PMID AS A UNIQUE
IDENTIFIER, THIS CAN CAUSE A BIT
OF AFTER PROBLEM, SO WE NEED A
WAY TO ISOLATE THE SPECIFIC
ELEMENTS THAT WE NEED. LET'S
JUMP BACK TO OUR SLIDES FOR A
MOMENT. THIS IS WHEN
PARENT/CHILD CONSTRUCTION CAN BE
REALLY HELPFUL. WE CAN
RETRIEVER AN ELEMENT THAT IS THE
CHILD OF A SPECIFIC PARENT.
THIS CAN HELP US ISOLATE THE
OBJECTS THAT HAVE THE SAME NAME,
BUT ARE IN DIFFERENCE LOCATIONS
IN THE HIERARCHY. ALL YOU NEED
TO DO IS USE A FORWARD SLASH.
IN THIS EXAMPLE, YOU CAN SEE WE
HAVE MEDLINE CITATION, SLASH
PMID.
THAT MEANS WE ARE LOOKING FOR
THE PMID THAT IS THE CHILD OF
THE MEDLINE'S CITATION ELEMENT.
IF WE GO BACK TO THIS EXAMPLE,
WE HAVE ALL THE TOOLS WE NEED TO
SOLVE IT. TO REFRESH YOUR
MEMORY, OUR GOAL WAS TO HAVE A
TABULAR LIST WITH THE PMID, THE
JOURNAL TA AND ARTICLE TITLE.
TO DO THIS, LET'S JUMP BACK TO
CYGWIN FOR A SECOND. I WILL
CLEAR MY SCREEN. I AM GOING TO
GO BACK TO THAT SAME EFETCH, SO
USE MY UP ARROW AND REMOVE THE
REST OF THIS. THEN WE'LL PIPE
THAT INTO OUR XTRACT. FIRST WE
NEED TO IDENTIFY OUR PATTERN.
SINCE WE KNOW WE WANT ONE ROW
PER RECORD, WE ARE GOING TO USE
PUBMED ARTICLE AGAIN. ADD THAT
IN. THEN WE NEED TO FIGURE OUT
WHICH ELEMENTS WE WANT TO
INCLUDE, SO WE KNOW WE ARE
LOOKING FOR PMID, JOURNAL TITLE
ABBREVIATION AND ARTICLE TITLE.
LET'S SWITCH OVER TO OUR PUBMED
XML. THIS IS THE SAME STRUCTURE
FOR ALL OF PUBMED RECORDS, SO WE
CAN USE THIS AS A BASIS, SO WE
KNOW WE WANT THIS PMID AT THE
TOP. IT WILL BE THE CHILD OF
MEDLINE CITATION. I CAN JUMP
BACK INTO CYGWIN AND ADD THAT AS
MY FIRST ELEMENT, MEDLINE
CITATION, SLASH, PMID. NOW I
CAN GO BACK TO THE XML. THE
NEXT THING I WANTED WAS THE
JOURNAL TITLE ABBREVIATION,
WHICH I HAPPEN TO KNOW IS THIS
ISO ABBREVIATION. THIS IS A
PLACE WHERE THAT LIST OF ALL OUR
MEDLINE ELEMENTS CAN BE HELPFUL.
SO I DON'T THINK THERE'S GOING
TO BE ANOTHER ONE OF THESE, BUT
WE CAN USE THE PARENT/CHILD
CONSTRUCTION AGAIN, BECAUSE THIS
IS THE CHILD OF JOURNAL.
LASTLY, WE HAVE ARTICLE TITLE.
I KNOW THIS ONE IS THE ONLY TIME
IT APPEARS IN THIS-- IN THE
XML, SO I CAN ADD THESE INTO MY
XTRACT I HAVE GOING HERE. THEN
ISO ABBREVIATION. LASTLY, WE
ARE ADDING IN ARTICLE TITLE.
LET'S RUN THAT, AND SO NOW WE'VE
GOT THIS SLIGHTLY CONVOLUTED
LIST BECAUSE OF THE-- THINGS
ARE WRAPPING, BUT WE HAVE THREE
COLUMNS. WE HAVE THE MEDLINE
CITATION PMID, THE ONE WE WERE
LOOKING FOR, THEN WE HAVE THE
JOURNAL TITLE ABBREVIATION IN
THE MIDDLE, THEN OUR LAST COLUMN
IS ARTICLE TITLE. IN FUTURE
CLASSES IN THIS, WE WILL TALK
MORE ABOUT HOW TO CLEAN UP HOW
THIS DISPLAY LOOKS. TODAY IT
WILL STAY A LITTLE MESSY, BUT
WE'LL FIX THAT IN NEXT CLASSES,
I PROMISE. ARE THERE ANY
QUESTION ABOUT THIS SO FAR? NOT
LOOKING LIKE IT, SO I WILL
CONTINUE ON. AS WE SAID AT THE
BEGINNING OF CLASS, SOME XML
ELEMENTS CAN ALSO HAVE
ATTRIBUTES. IN THE PUBMED XML,
THESE ATTRIBUTES CAN CARRY
IMPORTANT INFORMATION. YOU CAN
EASE THE AT SIGN. SO HERE YOU
CAN SEE WE WANT THE ATTRIBUTE
MAJOR TOPIC YN THAT IS THE CHILD
OF-- NOT THE CHILD. THE
ATTRIBUTE OF THE ELEMENT
DESCRIPTOR NAME. SO THIS IS THE
STRUCTURE YOU ARE GOING TO USE
WITH THIS. IF THAT MAKES SENSE.
LET ME KNOW IF IT DOESN'T. WE
ARE GOING TO MOVE ON-- NO, IT
DOES NOT MAKE SENSE. LET ME
JUMP INTO THE XML FOR A MOMENT
AND I SHOW YOU A LIT MORE WHAT
WE ARE LOOKING AT. SO HERE, WE
HAVE THE ELOCATION ID ELEMENT.
SO WHAT WE ARE LOOKING AT IS THE
ATTRIBUTE IS EID TYPE. THIS
ALSO HAS A VALUE. IF WE WANTED
TO EXTRACT JUST THIS VALUE, WE
NEED TO SPECIFY IN OUR XTRACT BY
SAYING WE WANT THE VALUE THAT IS
PART OF THE ATTRIBUTE, WHICH IS
PART OF THE ELEMENT. JUST THINK
OF REMOVING THE SPACE AND
STICKING AN AT SIGN THERE TO
MAKE IT AS SPECIFIC AS POSSIBLE.
DOES THAT HOPEFULLY CLEAR THAT
UP? GREAT, IT DOES, AWESOME.
LET'S JUMP BACK INTO OUR
POWERPOINT, SO WE CAN START THE
SECOND EXERCISE TODAY. SO WOULD
YEAH RETRIEVE DOI OR THE DOI
VALUE? I'M ACTUALLY GOING TO
SAY WELL WHY DON'T YOU TEST OUT
THIS NEXT EXERCISE AND HOPEFULLY
YOU'LL BEEN ABLE TO ANSWER THAT.
THAT'S KIND OF WHAT OUR EXERCISE
IS GOING TO SHOW YOU, SO LET'S
TAKE A LOOK AT THAT. THEN IF
YOU STILL HAVE QUESTIONS, WE
WILL GO THROUGH IT AGAIN. SO
OUR EXERCISE 2 IS GOING TO BE
WRITE AN XTRACT COMMAND THAT HAS
ONE ROW PER PUBMED RECORD. WE
WANT THREE COLUMNS, PMID,
JOURNAL ISSN AND CITATION
STATUS. PUT UP A GREEN CHECK
MARK WHEN YOU ARE FINISHED. THE
SOLUTIONS ARE AT THE BOTTOM OF
THE HANDOUT. IF YOU ARE HAVING
TROUBLE, YOU CAN GO DOWN THERE
AND WE WILL STICK HINTS IN THE
CHAT BOX AS WE GO AGAIN.
I'LL GIVE YOU A COUPLE MINUTES
TO WORK THROUGH THIS AND LET YOU
HAVE AT IT.
LOOKS LIKE YOU ARE GETTING
THROUGH IT, SO WE'RE GOING-- I
WILL DO THE EXAMPLE TO SHOW YOU
THE SOLUTION TO THE EXERCISE.
TOO MANY E WORDS TODAY. LET'S
GET STARTED. SO I WILL CLEAR MY
SCREEN.
WE SAID WE WANTED TO USE THE
SAME EFETCH WE HAVE BEEN USING.
FAVORITE THING EVER. I AM GOING
TO DO THE NEXT LINE, ADD IN THE
COMMAND XTRACT. THEN WE WANTED
ONE ROW PER PUBMED RECORD. THAT
IS GOING TO BE OUR PATTERN--
THE ROWS ARE GOING TO DETERMINE
OUR PATTERN, SO-- BECAUSE WE
WANT ONE PUBMED RECORD PER ROW,
THAT'S WHY WE WANT THE ARTICLE.
BUT AS KATHLEEN WAS ELUDING TO,
YOU CAN USE OTHER ELEMENTS INTO
ONE PER ROW, SO WE'LL SHOW YOU
LATER IN, I BELIEVE THE NEXT
EXERCISE. SO WE ADD IN PATTERN,
PUBMED ARTICLE. AND THEN FOR
OUR ELEMENTS, WE SAID WE ARE
WANTED THESE COLUMNS. OUR FIRST
ONE WAS PMID, SO I WILL USE
MEDLINE CITATION, SLASH, PMID.
WE WANTED TO USE THIS
PARENT/CHILD CONSTRUCTION TO
MAKE SURE WE ARE GETTING JUST
THE PMIDS THAT IS A CHILD OF
MEDLINE CITATION. AND THEN THE
NEXT WAS JOURNAL ISSN. I
BELIEVE WE JUST NEED THE ISSN
ELEMENT, BUT WE CAN USE THE
PARENT/CHILD CONSTRUCTION JUST
TO BE SAFE. SO I KNOW THAT IS
THE CHILD OF THE JOURNAL
ELEMENT. THEN LASTLY, WE NEED
THE CITATION STATUS, WHICH IS
PART OF THE STATUS ATTRIBUTE OF
MEDLINE CITATION. IF I LOOK
BRIEFLY BACK AT THE XML, JUST SO
I HIT EVERYBODY'S QUESTIONS FROM
EARLIER, WHAT WE WANT IS WE WANT
THIS STATUS HERE. THE CURRENT
ONE IS NOT GOING TO BE WHAT
SHOWS UP, SO WE KNOW THIS IS THE
ELEMENT, AND THEN THIS IS THE
ATTRIBUTE. WE WANT TO CONNECT
THOSE TWO WITH THE AT SIGN, AND
ADD IN MEDLINECITATION@STATUS.
SO NOW WE HAVE OUR THREE
COLUMNS. SO BARRY, HAS THAT
ANSWERED YOUR QUESTION?
AWESOME, GREAT. ARE THERE ANY
OTHER QUESTIONS BEFORE WE MOVE
ON TO OUR NEXT QUESTION? YOU
GET A DIFFERENT ISSN. WHICH
ISSN ARE YOU REFERRING TO?
OH, THE XML ON THE SCREEN WAS
DIFFERENT. SO IF YOU ARE
LOOKING AT MY EXAMPLE I JUST
SHOWED, THAT IS FROM A DIFFERENT
PMID, NOT FROM THE THREE THAT I
HAVE UP, BUT THE STRUCTURE IS
THE SAME. IF YOU LOOK AT THE
STRUCTURE, YOU CAN STILL SEE I
WAS LOOKING UNDER JOURNAL, AND
THEN THE ISSN. THAT SHOULD GET
ME THE ISSN THAT HAS BEEN
PROVIDED. SO IF WE MOVE ON TO
OUR NEXT EXERCISE, THIS ONE, WE
ARE GOING TO PUT IT ALL
TOGETHER. WE WANTED TO COMBINE
THE THINGS WE TALKED ABOUT IN
OUR CLASS ON MONDAY WITH WHAT WE
HAVE BEEN TALKING ABOUT TODAY.
WE WANT TO LOOK AT WHAT AUTHORS
HAVE BEEN WRITING ABOUT
TRAUMATIC BRAIN INJURY IN
ATHLETES. WE ONLY WANT TO LOOK
AT THE MOST RECENT PUBLICATIONS,
2016 AND 2017. SO HERE WE WANT
TO SEE JUST THE AUTHOR NAMES,
ONE PER LINE. SO THINK ABOUT
HOW THAT IS GOING TO AFFECT YOUR
PATTERN. THEN WE WANT TO SEE
JUST THE LAST NINE AND INITIAL.
SO WE ARE LOOKING FOR YOU GUY TO
WRITE THE ENTIRE SCRIPT, NOT
JUST THE XTRACT COMMAND. ONE
THING, A BIT OF ADVICE IS TRY
AND BUILD JUST ONE PART AT A
TIME, BECAUSE YOU WANT TO MAKE
SURE THAT WORKS BEFORE YOU MOVE
ON TO THE NEXT. THAT WAY, YOU
DON'T GET HUNG UP SOMEWHERE,
WHERE YOU COULD HAVE FIXED
SOMETHING IN YOUR FIRST LINE,
BUT YOU ADDED ANOTHER FOUR LINES
AND MESSED UP THE ENTIRE THING.
SO IF YOU BUILD LITTLE BIT BY
LITTLE BIT, YOU CAN STOP AND
CHECK AND MAKE SURE EVERYTHING
IS WORKING. GIVE YOU ABOUT FIVE
MINUTES OR SO TO WORK ON THIS,
AND GIVE ME A GREEN CHECK MARK
WHEN YOU ARE FINISHED, AND THEN
WE'LL GO OVER IT.
LET'S GO THROUGH THE
SOLUTION TO THIS. IF I HOP INTO
CYGWIN, CLEAR MY SCREEN. WE
SAID WE WANTED TO FIND OUT WHICH
AUTHORS WROTE ABOUT TRAUMATIC
BRAIN INJURY IN ATHLETES. THAT
IS OUR ESEARCH. SO LET'S START
WITH THAT. WE ARE STICKING WITH
DATABASE PUBMED, BECAUSE THAT'S
OUR FAVORITE DATABASE. WE ARE
GOING TO ADD IN THAT QUERY IS
JUST GOING TO BE TRAUMATIC BRAIN
INJURY ATHLETES. SPELLING
MULTIPLE THINGS WRONG. SO THEN
WE SAID WE WANTED TO LIMIT OUR
PUBLICATION DATES, SO YOU CAN DO
THAT IN THE QUERY OR LIKE WE
TALKED ABOUT MONDAY, USING THAT
DATE/TYPE PARAMETER. THEN OUR
MIN DATE IS 2016 AND MAX DATE IS
2017. I WILL RUN THIS, SO I CAN
MAKE SURE IT IS WORKING. I WILL
MAKE SURE THIS WORKS BEFORE I
MOVE ON TO THE NEXT. IF THIS
DOESN'T WORK, DOESN'T MATTER.
SO LET'S SEE HOW MANY WE GOT.
280 RESULTS. IT'S ABOUT WHAT I
EXPECTED. NOW WHAT WE WANT TO
DO IS FIGURE OUT HOW DO WE GET
THAT INTO OUR EFETCH. I WILL
USE MY UP ARROW KEY TO GET THAT,
PIPE THAT INTO MY EFETCH. NOW
WHAT I AM GOING TO DO IS PUT IN
THE FORMAT UID TO GET A LIST--
THIS LIST OF THE 280 PMIDS,
BECAUSE I HAVE BEEN SAYING USE A
SMALL SET TO TEST WITH. SO I
WILL TAKE THIS LIST OF PMIDS AND
GRAB JUST COUPLE OF THEM, SO I
CAN USE THAT AS MY EXAMPLE
EFETCH. I WILL BE TYPING RIGHT
AT THE BOTTOM. OTHERWISE, IT
DOESN'T LIKE IF I SCROLL THIS.
SO I WILL ADD EFETCH, WE ARE
USING PMIDS, I WILL ADD IN ID.
GRAB THIS ONE AND PASTE USING A
COUPLE COMMAS, AND THEN I'LL
GRAB THE LAST ONE. SO WE'VE GOT
OUR EFETCH, BECAUSE WE ALWAYS
NEED EVERYTHING TO BE IN XML, SO
I WILL USE MY FORMAT XML. SO
NOW I HAVE THE XML OF THESE
THREE PMIDS. I DON'T NEED THEM
RIGHT THIS VERY SECOND, SO I
WILL CLEAR MY SCREEN, SO YOU CAN
SEE IT A LIT EASIER. THEN I AM
GOING TO USE MY UP ARROW TO GET
BACK TO THIS EFETCH. I'VE GOT
MY SMALL SAMPLE SET. AND FORMAT
XML. I WILL PIPE THIS INTO ANY
XTRACT. THIS IS WHERE WE START
TO BUILD IT. WE WANTED TO SEE
JUST THE AUTHOR NAMES, SO THAT
SHOULD BE OUR PATTERN. SO WE
WANT TO LOOK AT PATTERN AUTHOR.
THAT'S WHAT IDENTIFIES ALL THE
INFORMATION ON THAT LINE.
THAT'S WHAT'S GOING TO CONNECT
EVERYTHING THERE. THEN LASTLY,
WE SAID WE WANTED TO SEE JUST
THE LAST NAME AND INITIALS. WE
ARE GOING TO ADD IN ELEMENT,
LAST NAME AND INITIALS. NOW I'M
GOING TO RUN THIS TO MAKE SURE
MY XTRACT IS WORKING, SO NOW WE
HAVE THIS LIST OF AUTHORS. AS
NANCY POINTED OUT, THOSE ARE NOT
ACTUALLY SPACES. THOSE ARE IN A
SEPARATE COLUMN, BUT BECAUSE
SOME OF THOSE LAST NAMES ARE SO
LONG, IT BUMPS IT OVER A LITTLE.
WE WILL TALK ABOUT HOW TO MAKE
THIS FIT A LITTLE NICER ON
MONDAY. NOW WE CAN STOP AND PUT
THIS ALL TOGETHER. IF I KEEP
EVERYTHING NICE AND CLEAR, I AM
GOING TO PASTE THIS IN JUST TO
MAKE SURE I DON'T MISTYPE
ANYTHING. HERE WE HAVE PUT IT
ALL TOGETHER. WE HAVE OUR
ESEARCH FROM THE BEGINNING,
TRAUMATIC BRAIN INJURY ATHLETES,
DATE TYPE TO RESTRICT IT TO 2016
AND 2017, AND THEN WE HAVE PIPED
THAT INTO OUR EFETCH WITH FORMAT
XML. THEN WE ARE GOING TO
EXTRACT BASED ON THE PATTERN
AUTHOR, SO WE GET ONE PER LINE,
THEN WE ARE GOING TO LOOK AT THE
ELEMENTS LAST NINE AND INITIALS.
IF I HIT ENTER, IT TAKE A SECOND
OR TWO TO RUN BECAUSE AS WE SAW
IN OUR ESEARCH, THERE ARE 280
RESULTS. IT WILL TAKE A COUPLE
SECONDS TO RETRIEVER ALL THE
AUTHORS FROM ALL OF THOSE. NOW
WE HAVE THIS LIST OF ALL OUR
AUTHORS. THIS IS OUR SOLUTION.
MAYBE IT'S A NICEST FORMATTING,
BUT THIS IS OUR RESULT. IN OUR
NEXT CLASS, WE WILL TALK A
LITTLE MORE ABOUT THE DIFFERENCE
WAYS OF FINE-TUNING THE OUTPUT
FORMAT TO MAKE IT AS CLEAN AND
USEFUL AS POSSIBLE.
BEFORE WE GO, I WANT TO SHOW YOU
TWO MORE COMMANDS THAT CAN HELP
YOU OUT IN THIS REGARD. RIGHT
NOW, THIS IS JUST A LIST OF
AUTHORS. THERE ARE PROBABLY A
LOT OF DUPLICATES, ESPECIALLY IF
AUTHORS ARE PUBLISHING MULTIPLE
ARTICLES ON THE SAME TOPIC. IF
WE WANTED TO SEE THE MOST
PROLIFIC AUTHORS ON A GIVEN
TOPIC, WE CAN USE UNIQUE COUNT
RANK. SOUNDS A LITTLE FUNKY,
BUT IT IS GREAT. I AM GOING TO
CLEAR MY SCREEN SO I CAN SHOW IT
TO YOU. I WILL PASTE IN THE
SAME CODE I JUST USED. IT LOOKS
A LITTLE NICER WHEN I PASTE IT
IN. I WILL PIPE THAT INTO THIS
COMMAND. SORT UNIQUE, AND COUNT
RANK. SO I AM GOING TO HIT
ENTER. WHAT THIS COMMAND DOES
IS IT SHOWS US EVERY UNIQUE
VALUE FROM OUR LIST OF AUTHORS,
ALONG WITH HOW MANY TIMES EACH
OF THOSE NAMES APPEARED, THEN
SORTS IT BY FREQUENCY. SO WE
HAVE ALL OUR LIST OF AUTHORS,
WITH THE ONE NEXT TO IT SAYING
HOW MANY TIMES THEY APPEAR IN
THIS LIST. IF I SCROLL TO THE
TOP, NOW YOU CAN SEE WE HAVE THE
MOST FREQUENTLY PUBLISHING
AUTHORS ON THIS TOPIC AT THE
TOP. THAT WAS WHAT WE WERE
LOOKING FOR. WE DO STILL HAVE
THIS LONG LIST OF AUTHORS, WITH
LONG LIST OF PEOPLE WHO ONLY
APPEAR ONCE. I'M GOING TO ADD
ONE MORE THING TO THIS COMMAND.
CLEAR MY SCREEN. WE PASTE IN
THE PREVIOUS COMMAND THAT I JUST
USED, SO YOU DON'T HAVE TO WATCH
ME STRUGGLE TO TYPE UNIQUE
CORRECT AGAIN, THEN I WILL TYPE
IN THE COMMAND HEAD. I WILL
SPECIFY N 10. I AM SAYING TAKE
THAT LIST THAT I JUST CREATED,
THEN ONLY SHOW ME THE TOP TEN
LINES OF THAT. SO THIS WILL
SHOW US THE TOP TEN MOST
FREQUENTLY OCCURRING AUTHORS ON
THE SPECIFIC SEARCH. SO THIS IS
HOW YOU CAN REALLY COMBINE A
BUNCH OF DIFFERENT ASPECTS OF
XTRACT AND PUT IT ALL TOGETHER
TO GET EXACTLY WHAT IT IS YOU
ARE LOOKING FOR.
ANY QUESTIONS ABOUT THIS? WE
ARE GOING TO HAVE MIKE RESPOND
TO-- AT THE END OF THE CLASS,
IN TERMS OF WHETHER OR NOT YOU
CAN HAVE MULTIPLE PATTERNS. I
WILL KEEP GOING FOR A SECOND AND
HOP BACK TO THE SLIDES. NEXT
WEEK, WE ARE GOING TO CONTINUE
OUR DISCUSSION OF XTRACT AND
TALK ABOUT MORE ADVANCED
ARGUMENTS. WE ARE ALSO GOING TO
COVER WAYS TO PUT ALL OF WHAT WE
HAVE LEARNED TOGETHER AND SOME
TIPS FOR DEVELOPING PRACTICAL
SOLUTIONS TO REAL-WORLD
PROBLEMS. WE ENCOURAGE YOU TO
VISIT OUR WEB SITE FOR MORE
INFORMATION AND DOCUMENTATION ON
EDIRECT, AS WELL AS THE SCRIPT
SLIDES, THEN THE RECORDING, AS
SOON AS WE CAN PUT IT UP. WE
WILL SEND OUT THE RECORDING
RIGHT-- AS SOON AS POSSIBLE,
WHERE LIKE WE DID MONDAY. WE
ENCOURAGE YOU TO SIGN UP FOR THE
UTILITIES ANNOUNCE MAILING LIST.
IT WILL HELP KEEP YOU UP-TO-DATE
ON ANY BIG CHANGES THAT COME
THROUGH. FROM THAT SAME BUTTON,
YOU CAN ALSO SEND US ANY
QUESTIONS YOU HAVE DURING THE
WEEK. THEN LASTLY, AT THE
BOTTOM OF YOUR HOME-- HANDOUT
FROM TODAY IS THE HOMEWORK FOR
TONIGHT. THE EXERCISES THERE,
AND LASTLY, WE WOULD LIKE YOU TO
SEND US YOUR CASE STUDIES.
ON OUR FINAL CLASS OF THIS
SESSION, WE WILL TAKE A LOOK AT
A BUNCH OF DIFFERENT CASE
STUDIES, TO LOOK AT HOW WE CAN
CREATE THE BEST SOLUTIONS.
WE WANT TO MAKE THIS MORE
INTERACTIVE AND USEFUL FOR YOU,
SO SEND US THINGS YOU THINK, OH,
I THINK IT COULD BENEFIT FROM
EDIRECT, SEND THEM TO US. WE
HAVE AN EMAIL ADDRESS HERE, AND
YOU CAN ALSO USE THE CONTACT US
FORM ON YOUR WEB SITE. EITHER
OF THOSE WILL GET IT TO US AND
WE WILL INCORPORATE IT,