text:
At about the same time that Sergeant Bjarne Nielsen was being loaded onto a medical plane heading out of Afghanistan, his daughter, six-year-old Heather Nielsen and her mum, Maxine, were making fondant-sugar butterflies in Cambridge, Ont., for Canada Day. "Mommy, there are soldiers at the door," Heather said, as she looked out of the window. The tow of them opened the door together, faced the news from a padre together, sat down and cried together. "He promised me he wouldn't get hurt," the little girl sobbed. "Daddy is very sorry," Ms. Nielsen told her daughter. "He didn't mean to. He needs us to be really strong soldiers now, and he needs our love to help him get better. Let's forgive Daddy and kick his butt when we see him." "I had a moment with my God and prayed for strength for what we were about to encounter," she recalled later. "This very strong man needed me to be strong … and I wanted Bjarne to be proud of me." It is 1983. On a farm in southern Ontario a four-year-old boy sits on the gate of a horse paddock. His grandfather has recently taught him how to crack a whip. Crack. Crack. He lets the gate swing open and whips the air as the horses thunder by. Crack. Crack. He loves how the horses run and buck. One old mare takes umbrage at this game and kicks out at the boy's head. Crack. The boy falls. Crack.
It was early in the morning of Canada Day 2010 when a patrol left Combat Outpost Ballpein, a base built from the burnt-out ruins of a schoolhouse near the village of Nakhonay in Panjwaii District, in Kandahar Province, Afghanistan. Nakhonay village is a small community of farmers, and Taliban. It has always tended to support the insurgency -- remarkable considering it is only 20 kilometres to Kandahar Airfield (KAF.) Sergeant Bjarne Nielsen was leading the 11-man patrol, which included members of the 6th Platoon of Bravo Company of the 2nd Royal Canadian Regiment. He had been in Afghanistan for about seven weeks when his patrol left through the north gate, into the alleyways of Nakhonay. He took up position in the front of the patrol. After two months in theatre, Sgt. Nielsen knew the territory better than anyone and how dangerous it was. Having patrolled together many times, his platoon had also learned their lessons. "We trained ourselves and took pride in the fact that we would walk in one another's footprints," Sgt. Nielsen said. Before entering the grape fields, Sgt. Nielsen called a halt and had everyone perform their fives and twenties – a standard search pattern in which everyone studied the terrain around them and looked for anomalies; a wire, newly disturbed earth, or a marker like a piece of wool. When nothing was found, Sgt. Nielsen walked back along the patrol to collect the fire team who would take over the lead. He doesn't remember how many steps he took – two, maybe three – but he remembers a blinding bang-flash of light. Someone had stepped on a pressure plate and activated an IED. The explosion was just behind and to the left of him, catching him mid stride. The initial wave of shrapnel ripped all the muscle and flesh from his left leg, tore out most of his left buttock, opened his left arm like a flower, and punctured a hole through his abdomen. The blast threw him high in the air. In the dust cloud and confusion immediately afterwards, the rest of the patrol could not locate him. They only knew that their sergeant had been struck because his radio was hanging in a tree. Sgt. Nielsen doesn't remember flying through the air. He came to on an incline in a grape field with his left arm pinned behind him. "It wasn't like pain. It was more like intense pressure, as if something gargantuan was squeezing the crap out of my left arm and my left leg. I knew at that time what had happened ... and I accepted what had happened." Incredibly, he remembered his drills and did a self-assessment. "All of my first aid supplies were on the left side of my body, so I knew right away they were gone. I knew I wasn't going to be able to apply first aid." As the dust settled, he called out to his soldiers on the other side of the wall. He remembers speaking clearly and slowly, in order not to panic. "Once you start panicking, that is when things go bad. That was something I had tried to train into my soldiers. You have got to stay cool. I think I did OK." He remembers feeling some relief as some of those soldiers made their way over the wall to him. The medic, Cpl. Matthew Hill, Cpl. Chad Myron, and Cpl. Steve Cunningham arrived around the same time and started to work on his wounds. He slipped into unconsciousness; his soldiers slapped him to bring him round. "I told them to tell my daughter and my wife that I loved them." They applied tourniquets to what was left of his leg, and after discovering his mangled left arm underneath him, bandaged what remained. They loaded him onto a stretcher and started an IV, and then moved him across the grape field toward a hole in the wall — up and over each two-metre mound, up and down, up and down, again and again. "I guess they were having a tough time carrying me across...and almost dropped me. Apparently I reached up, grabbed onto someone and told him to f---ing do his job and hold me up. Still doing my sergeant thing, even with half my body gone." His second-in-command, Master Cpl. James Nuttall, had organized the medivac helicopter. It was one of the fastest extractions ever out of that area. The last thing Sgt. Nielsen remembered was being loaded onto the helicopter. Then blackness.
It is 1989. A ten-year-old boy jumps up and down on a concrete well cover, daring it to break. It eventually obliges and he falls four metres down the well in a flurry of dust and concrete.
Dr. Vivian McCallister was on his third tour as a soldier-surgeon in Afghanistan that summer. Having originally volunteered as a civilian in 2007, Dr. McCallister found the work so fulfilling that he joined the army so he could continue. They made him a major. He had just finished surgery at the hospital at KAF and was heading toward the Canada Day celebrations when he was paged to return. The field medics had done an incredible job with Sgt. Nielsen, but when the helicopter touched down he was very close to death. "He was bleeding heavily despite multiple tourniquets because the injuries extended up into the groin." said Dr. McCallister. In the operating room, two orthopedic surgeons tried to stop the bleeding from the outside while Dr. McCallister and another surgeon worked on the inside. With the worst bleeding stopped, the next task was to clean out the wounds — they had about an hour before gangrene set in. "There was so much soil in the wounds you would think the Taliban were trying to send Bjarne home with all of Afghanistan in him," said Dr. McCallister. Still, it looked like they might be able to save Sgt. Nielsen's arm. Two of the surgeons fixed it in place with what looked like a big Meccano set. After 50 minutes in surgery, and 24 pints of blood, the sergeant was moved to the Intensive Care Unit. Twelve hours later, he was stable enough to move and was handed off to the Critical Care Transport Team and flown to Landstuhl, in Germany. "We all saluted his bravery and wished him well," said Dr. McCallister.
It is 1992. A 13-year-old boy and his sister help their grandfather clear stumps from his property using a tractor and some chain. His sister is deaf. To the boy's chagrin his sister gets to drive the tractor, while he has to carry the spare chain and walk behind. The boy's sister - reveling in her newfound position of driver - floors the accelerator. The boy is dragged behind the tractor eating dirt and grass as he goes.
It took three days for Ms. Nielsen to get herself to Germany. "I thought about the women who don't have their husbands coming home and it just made me more motivated to do something about the one who is alive," she said. At the Landstuhl hospital, the strong, independent, adrenalin-fuelled army machine that she had fallen in love with was gone. Sgt. Nielsen was hidden under bandages and swelling, with tubes and wires covering every surface of his body. He was unconscious and in a state of continual organ failure while having daily transfusions because his red blood cell count was so low. As soon as his family was in his hospital room, his vital signs began to improve. His wife held him and cried. "He opened his eyes shortly after that and kept his eyes open. They took the breathing tube out that night," she said. He was unable to talk but he could grunt and he could use his good arm for sign language. She spent the next week with her head by his head listening to him breathe whenever they were together. "I had my head right by his head. We kind of grunted to each other for the first little while, it was so amazing. We just cried and sighed, we didn't have to talk. It was the most beautiful experience."
It is 1995 and a group of boys run around a farmyard with lit Roman candles chasing one another and shooting them. They use straw bales as shields in their makeshift war.
After ten days in Germany, Sgt. Nielsen was flown back to Canada aboard the Prime Minister's plane. He went into intensive care at a Toronto hospital and Ms. Nielsen went home to talk to Heather. "I just told her that Daddy hurt his leg really badly. I told her Daddy had to get a new leg because the doctor had to take it off because it was so badly broken," she said. The next six months were numerous operations, setbacks and successes; then, Ms. Nielsen says, his natural strength of character and willpower started to come through. "People think it is because of the army, the way he is," she said. "But it is not because of the army. The army allows him to be the way he is. That is who he is." Sometimes, though, expectations proved difficult. "Whenever he had visitors … he would want to seem like he was doing so well … And he was doing well, but it would exhaust him. As soon as they left the room, there would be crying." She added, "During the first seven months he would tell me every day, 'Thank you so much.' Eventually I said, 'Look, just give me one big thank you and be done with it.'" Sgt. Nielsen needed 24-hour care and his wife was there through it all. "Maxine has been a vital part of my recovery," he said. "She is pretty much a qualified nurse from everything that she has done. She has done bandage changes, helped with my IV, you name it, she has done it." "I was the only one who could put him to sleep for a while," said Ms. Nielsen. "Strangely, it was the best time of my life. "Now he knows I love him. He knows I love him no matter what." In January, Sgt. Nielsen moved home to Cambridge and started physiotherapy. He had a resurgent infection in his arm due to dirt from the explosion. By March, he could hop up a flight of 12 stairs on his own and had even helped move furniture around their house. Determined to walk properly again — "When I walk, I want to have that natural gait" — he acted on a suggestion from his regimental sergeant-major and moved to a rehab centre north of Ottawa where the intensity of training and rehabilitation techniques better suited his drive to progress. The hardest part was leaving his wife and daughter behind — the couple now only sees each other at weekends. But on June 26, Maxine and Heather made a special trip to Ottawa to be with him for the fitting of his prosthetic limb. "It was different at first, because for so long I had to learn a new centre of balance," said Sgt. Nielsen. "Once I had this leg, I could stand there and not hold onto something. And that is cool, that is the coolest thing ever." Said Ms. Nielsen: "He made it look like someone who had been walking for a long time. It was so emotional, so incredible to see him standing up straight." Three days later, Sgt. Nielsen got more good news — he was finally free of the infection caused by the Afghan soil. He was finally — literally — free of Afghanistan. He is now wondering what to do with the rest of his life. He has a promising future with the army, but isn't sure what direction he wants to go. He knows he wants to do something that helps people, "something to do with helping families." Dr. McCallister has this to say about Sgt. Nielsen's future: "I have seen a saying written on a wall in Afghanistan, 'When some give all, all should give some.' We have been blessed to have been asked to look after Bjarne. He nearly gave all. Now he will get better and give some more." National Post All illustrations by Richard Johnson, National Post. Contact the illustrator: firstname.lastname@example.com www.newsillustrator.com


text:
Dr Daniel Fung is married to Joyce and the father of 5 grown up children. He is currently the Chairman Medical Board of Singapore's Institute of Mental Health since 2011. Dr Fung is an Adjunct Associate Professor at all 3 medical schools in Singapore.
Dr Fung is currently the President of the International Association for Child and Adolescent Psychiatry and Allied Professions. He was awarded the National Day (Public Service Administration (Bronze)) Award in 2017 and the National Medical Excellence Award (Team) in 2018 for his work on community and school based mental health.
Dr Fung is interested in the treatment of emotional and behavioural disorders in children and he has advocated for the development of child mental health services and strategies through his research
Dr Fung's research is supported by the National Medical Research Council and other agencies. He has co-authored over 160 peer reviewed research papers (118), books (32) and book chapters(18).
Dr. Christina Schwenck is professor for Special Needs Educational and Clinical Child and Adolescent Psychology at the University of Giessen, Germany. She is a trained child and adolescent psychotherapist (specification behavior therapy) and a trained supervisor. Her research interests comprise selective mutism, conduct disorder, and children of parents with mental illness. She has published 56 articles in peer-reviewed journals and several book chapters on childhood mental health. She is editor of three book series on child and adolescent psychotherapy, psychology in school and psychotherapeutic children´s books. In her free time, she follows her passion for photography around the globe.
Dr. Schwenck is currently the Secretary General of the International Association for Child and Adolescent Psychiatry and Allied Professions (IACAPAP). Her vision is to strengthen training and promotion of child and adolescent mental health professionals, particularly in low- and middle-income countries, including long-term mentorships for early career scientists and clinicians in this important field. Furthermore, she aims at alluring allied professions for IACAPAP to enhance active collaboration between professions in order to provide optimal supply for children and adolescents with mental health problems.
Dr. Andrés Martin is the Riva Ariella Ritvo Professor at the Child Study Center, Yale School of Medicine, in New Haven, CT, USA. A native of Mexico City, he obtained his MD from the Universidad Nacional Autónoma de México, and trained in psychiatry and child and adolescent psychiatry at Harvard Medical School-affiliated hospitals. He obtained his MPH in chronic disease epidemiology from the Yale School of Public Health, and is currently a PhD candidate in medical education at the University of Groningen, in the Netherlands.
Dr. Martin has been affiliated with IACAPAP since 2004, when he helped coordinate the first Donald J. Cohen Mentorship Program in Berlin. For the next ten years he co-led the Program with Dr. Joaquín Fuentes from Spain, before passing on the leadership responsibility to younger colleagues (and Program alumni) Ayesha Mian from Pakistan and Naoufel Gaddour from Tunisia.
Dr. Martin is editor emeritus of the Journal of the American Academy of Child and Adolescent Psychiatry, past editor of the IACAPAP Bulletin, and since 2018, co-editor of J.M. Rey's IACAPAP e-Textbook of Child and Adolescent Mental Health. Together with Drs. Matías Irarrázabal from Chile and Joaquín Fuentes from Spain, he coordinated the first complete translation of the e-Textbook, into Spanish.
Currently a Vice-president of IACAPAP (for North and Latin America), Dr. Martin also serves as the Association's liaison to its flagship scholarly outlet, Child and Adolescent Psychiatry and Mental Health.
After receiving B.A. at College of Medicine, Seoul National University, Dr. Kim BN received both M.A. and Ph.D. at Graduate School of Medicine, Seoul National University.
Since 2002, he has been a Professor at College of Medicine, Seoul National University and has been working as the division director of the Child and Adolescent Psychiatry, Seoul National University Hospital.
His main fields of research include brain imaging, genetic & environmental studies of Neurodevelopmental Disorders including ADHD, ASD and Tic disorders. He has published 157 peer reviewed articles in SCI-International Journals & 62 articles in Korean Journals. He has also taken charge of some public mental heath research & educational programs for governmental mental health system and policy development for children & adolescents.
From 2009 to 2011, he spent 2 years in Queensland Brain Institute & Child Trauma Center, Kids in Mind, University of Queensland, Brisbane, Australia as a visiting professor, and he extended his sincere interest to the psychiatry community, school based mental health & social psychiatry for youngsters. Since returning to Korea, he has actively engaged himself in several social acts. He has served as the chairperson of the Korean Association for Persons with Autism, and he has collaborated with the Korean government including the Ministry of Health and Welfare, the Ministry of Education, and the Ministry of Justice.
He also participates actively in the KACAP and is working as a director of academic affairs, a director of international affairs, and he is contributing to international associations as a full member of Executive Committee member of IACAPAP & ASCAPAP.
Current Positions
– Professor, Department of Psychiatry (Child & Adolescent) College of Medicine, Seoul National University
– Director, Division of Child & Adolescent Psychiatry, Seoul National University Hospital
– Director, ADHD and Neurodevelopmental Disorders Translational Research Center
– Director, Emotion & Quality of Life Center, Seoul National University Children's Hospital.
– Vice President, IACAPAP
After some initial training in mathematics and fundamental physics (Ecole Polytechnique, Paris), Bruno Falissard engaged in medical studies and specialized in Child and Adolescent Psychiatry in 1991. His PhD was in biostatistics and his post doc in psychometrics and exploratory multimensional methods. He was assistant professor in child and adolescent psychiatry in 1996-1997 and full professor in Public health from 2002.
He is at the head of the "Center of research in Epidemiology and Population Health" (500 members). He is co-author of about 400 papers and author of 4 books. He has a clinical activity in child and adolescent psychiatry. His personal areas of research are about methodology and epistemology of mental health research. He was president of IACAPAP (International Association of Child and Adolescent Psychiatry and Allied Professions) from 2015 to 2018, and he is a member of the French Academy of Medicine.
Joseph M. Rey, a consultant child and adolescent psychiatrist, has worked helping children, teenagers and their families for more than 30 years. As director of Sydney's Rivendell Unit, he contributed to the introduction of systematic assessment and the delivery of treatment packages for specific disorders in Australian child psychiatric practice.
As director of child and adolescent mental health services in Northern Sydney, he established a comprehensive and integrated child and adolescent mental health service. He has been conjoint professor of child and adolescent psychiatry at the University of Sydney and professor of psychiatry at Notre Dame University Medical School Sydney.
Dr Rey has published more than 200 research and educational papers as well as several books in areas as disparate as depression, alternative treatments, epidemiology, diagnosis, disruptive behaviour disorders, marijuana use, and ECT, to name a few. For his contribution to the IACAPAP Bulletin and the IACAPAP e-Textbook of Child and Adolescent Mental Health, he was presented the IACAPAP Medal in 2012 and the International Contribution Award in 2014.
Kaija Puura, M.D., Ph.D is Professor of Child Psychiatry in Tampere University, Finland, and Chief of Child Psychiatry in Tampere University Hospital. She has authored or co-authored over 80 peer reviewed articles, and chapters in both national and international books on assessment and treatment of young children, and is an Associate Editor of the Infant Mental Health Journal.
Her research interests cut across the following areas: gene-environment interplay in social and emotional development of young children; emotion regulation and shared pleasure and joy in parent-child interaction; development of digitalized services for families with young children and use of virtual reality as a part of child psychiatric treatment. She is a member of the Finnish Child Psychiatric Association, and of the World Association for Infant Mental Health.
She received the WAIMH New Investigator Award (2002), was appointed Associate Executive Director of the WAIMH 2009, and Executive Director of WAIMH 2018. In July 2018 Professor Puura became Vice President of the International Association for Child and Adolescent Psychiatry and Allied Professions.
Dr Maite Ferrin obtained her medical degree at the University of Navarra, Spain, before completing her MSc (Child and Adolescent Mental Health) and PhD (Neuroscience) research at King's College London and the University of Granada respectively.
Dr Ferrin has been a full-time Consultant Psychiatrist since 2006, specialising in child and adolescent psychiatry and with a special interest in neurodevelopmental conditions.
She has lead psychoeducation projects for patients with ADHD and ASC, their families and their teachers in both Spain and London. She has sat on the European ADHD Guidelines Group (EAGG, Eunethydis) and is part of the Steering Committee for the ADHD Continuum European project since 2010.
Dr Ferrin is also active in research, with more than 40 international peer-reviewed publications and book chapters on ADHD, ASD and Early Onset Psychosis to her name. She is a peer reviewer for several international child and adolescent psychiatry journals, Deputy Editor of the IACAPAP Bulletin, and Vice President of IACAPAP.
Myron L. Belfer, MD, MPA is Professor of Psychiatry in the Department of Psychiatry, Children's Hospital Boston, Harvard Medical School. He is on the Affiliated Faculty of the Harvard Center for the Developing Child. Dr. Belfer led the child mental health program at the WHO from 2000 to 2005 where he developed the child mental health Atlas. He is past-President of the International Association for Child and Adolescent Psychiatry and Allied Professions (IACAPAP).
He founded Boston Children's Hospital Global Child Mental Health Observership Program and directed for the Harvard Center on the Developing Child a comprehensive child mental health needs assessment in schools in Shanghai with Chinese colleagues. He was a consultant to the Temasek Foundation (Singapore) project on child mental health capacity building for disaster response in Indonesia. For the IOM and WHO he worked in Thailand and Indonesia after the tsunami.
His current interest is in building global mental health capacity. The latter currently involves the development of a comprehensive child mental health program in Shenzhen, China. As a clinician he worked closely with plastic and reconstructive surgeons on understanding the development of body image in children.
"I am a child and adolescent psychiatrist, my pre and post graduate training (1966-1973) was in the University of Chile. Later I did short post graduate training visits at the Institute of Psychiatry, Maudsley and Bethlem Royal hospitals in London and North Shore University and Bellevue hospitals in New York.
I am now retired from my clinical practice after seeing patients and their families for 50 years, 18 of which were in the public health sector and 31 in a private hospital where I founded the child and adolescent psychiatric unit.
I have always been interested in public health, and formed part of the staff in the Mental Health Department of the Ministry of Health when we recovered democracy, in charge of designing and implementing the Child and Adolescent Mental Health and the Child Maltreatment programs.
I am adjunct professor at the Eastern Medical Faculty of the University of Chile since 1975, where I have been involved mainly in postgraduate teaching in mental health, but also of paediatricians, teachers and professionals working with children, as well as psychoeducation for parents and the community in every opportunity available. My line of research has been child psychiatric epidemiology in schoolchildren and in the community as well as child abuse. I have published more than 80 papers and book chapters.
I belong to the Chilean scientific associations of Child and Adolescent Neurology and Psychiatry and of Psychiatry, Neurology and Neurosurgery, which have awarded me the utmost distinctions a professional can receive, that is from the peers. I also belong to the Pediatrics and Mental Health Chilean associations, The AACAP from USA and ACAMH from the UK. I am very grateful for all the information I receive and use permanently from all the institutions I have mentioned.
I have always admired IACAPAP´s work in disseminating knowledge about mental health and helping to train specialists in the field. However, living so far away at the southern end of Latin America, I have not been able to attend meetings in a regular basis.
I see my role in IACAPAP in two areas:
1.- further connecting Chilean and Latin American professionals with opportunities for continuous training and professionals from different parts of the world and
2.- Enhancing visibility of the contributions that this region of the world can do for global child and adolescent mental health.
In that direction I suggest that, if any member of IACAPAP wants to know about mental health in Chile, he or she can open the link de la Barra F, Irarrazaval M, Valdes A, Soto-Brandt G. Evolving child and adolescent mental health and development programs
in Chile. Rev Panam Salud Publica. 2019; 43: e33. https://doi.org/10.26633/RPSP.2019.33."
"My main scientific activities and interests are: Developmental Psychopathology, Forensic Psychiatry, Eating Disorders, Schizophrenia Research, Psychiatric Genetics, Treatment- and Evaluation Research.
I invested plenty of time and energy in measures for the qualification of young researchers and founded together with Martin Schmidt (Mannheim) Research Seminars, that I consecutively transferred to the European and International level. The international Association of Child and Adolescent Psychiatry and Allied Professions (IACAPAP) has named them now as Helmut-Remschmidt-Research-Seminars.
In 2004 I founded the Donald Cohen Fellowship Program for young researchers, a biannual program integrated into the IACAPAP World Congresses.
Another important engagement was devoted to therapeutic training and education of physicians and psychologists working in the field of Child- and Adolescent Mental Health. In 1981 I founded a training seminar for Child- and Family Therapy at the Philipps University Marburg, continued now as the "Institute for Behaviour Therapy and Behavioral Medicine". Together with my co-workers I carried out several treatment projects and developed quite a number of instruments for treatment evaluation, now widely used in Germany and in Europe.
Finally, it was always my intention to internationalize German Child- and Adolescent-Psychiatry. Through my engagement in international Research Societies I was able to organize the Congress of the European Society for Child- and Adolescent-Psychiatry (ESCAP) in Germany (Hamburg 1999) as well as the World Congress of the International Association for Child- and Adolescent Psychiatry and Allied Professions (IACAPAP) (Berlin 2004)." – Helmut Remschmidt, MD, PhD
Editor and former Editor of several scientific Journals in the field of Child Mental Health, Psychiatry and Criminology. More than 400 article in peer reviewed Journals and books. Member of the Editorial Board of more than 30 Journals.
Association Name (English)
Chinese Society of Child and Adolescent Psychiatry
Association Name (in native language)
About the association
The Chinese Society of Child and Adolescent Psychiatry (CSCAP) established in 1989, is a professional organization for child and adolescent psychiatrists in China. Its mission is to promote the academic communication and cooperation among professionals in the field of child and adolescent mental health and to improve the development of child and adolescent psychiatry and mental Health of children and adolescents in China. Since establishment, it has been attracting more and more professionals related with child and adolescent mental health and provides a platform for child and adolescent psychiatrists and allied professionals to share, communicate and cooperate in the field of prevention, clinical service and research of child and adolescent mental disorders. It also improves the international communication and cooperation in the field of child and adolescent mental health. All of these have promoted the development of child and adolescent psychiatry and mental health of child and adolescents in China.
Key appointment holders
Yi Zheng, MD, Professor of Child and Adolescent Psychiatry
Contact Information
Association Name (English)
Malaysian Child And Adolescent Psychiatry Association
Association Name (in native language)
Persatuan Psikiatri Kanak-Kanak Dan Remaja Malaysia
About the association
Key appointment holders
Contact Information

subset: commoncrawl


text:
Difference between revisions of " Nano Sparql Server"
Brad Bebee (Talk | contribs)
(→GET or POST)
Brad Bebee (Talk | contribs)
|Line 654:
|Line 654:
While this example will only report the fast range count for all triples having the specified subject URI:
While this example will only report the fast range count for all triples having the specified subject URI:
curl -G -H 'Accept: application/xml' 'http://localhost:8080/bigdata/sparql' --data-urlencode ESTCARD --data-urlencode 's=<http://www.w3.org/People/Berners-Lee/card#i>'
curl -G -H 'Accept: application/xml' 'http://localhost:8080/bigdata/sparql'
--data-urlencode ESTCARD --data-urlencode 's=<http://www.w3.org/People/Berners-Lee/card#i>'
Revision as of 15:29, 20 June 2015
NanoSparqlServer provides a light weight REST API for RDF. It is implemented using the Servlet API. You can run NanoSparqlServer from the command line and or embedded within your application using the bundled jetty dependencies. You can also deploy the REST API Servlets into a standard servlet engine.
- 1 Deploying NanoSparqlServer
- 1.1 Downloading the Executable Jar
- 1.2 Command line (using jetty)
- 1.3 Embedded (using jetty)
- 1.4 Servlet Container (Tomcat, jetty, etc)
- 1.5 Highly Available Replication Cluster (HA)
- 1.6 Scale-out (cluster / federation)
- 2.1 SPARQL End Point
- 2.2 MIME Types
- 2.3 Mutation Result
- 2.4 API Atomicity
- 2.5 API Parameters
- 2.14 Multi-Tenancy API
- 2.15 Transaction Management
- 2.15.1 Choosing the right transaction model
- 2.15.2 Transaction Management API
- 3 Java Client API
- 4 Query Optimization
Deploying NanoSparqlServer
You DO NOT need to deploy the Sesame WAR to run NanoSparqlServer. NanoSparqlServer can be run from the command line (using jetty) embedded (using jetty) or deployed in a servlet container such as Tomcat. By far the easiest way to deploy it is in a servlet container.
Downloading the Executable Jar
Download [the latest bigdata-bundled.jar file]. Alternatively you can build the bigdata-bundled.jar file:
java -server -Xmx4g -jar bigdata-bundled.jar
You may also check out the code and use the ant task to generate the jar.
ant clean executable-jar
This generates ant-build/bigdata-bundled.jar.
java -server -Xmx4g -jar ant-build/bigdata-_X_Y_Z_YYYYMMDD-bundled.jar
Once it's started, the default is http://localhost:9999/bigdata/.
java -server -Xmx4g -jar bigdata-_X_Y_Z_YYYYMMDD-bundled.jar (i.e. bigdata-1.5.1-20150320.jar) ... serviceURL: http://127.0.0.1:9999 Welcome to Blazegraph(tm) by SYSTAP. Go to http://localhost:9999/bigdata/ to get started.
You can specify the properties file used with the -Dbigdata.propertyFile=<path>.
java -server -Xmx4g -Dbigdata.propertyFile=/etc/blazegraph/RWStore.properties -jar bigdata-bundled.jar
Command line (using jetty)
To run the server from the command line (using jetty), you first need to know how your classpath should be set. The
bundleJar target of the top-level
build.xml file can be invoked to generate a
bundle-<version>.jar file to simplify classpath definition. Look in the bigdata-perf directories for examples of ant scripts which do this.
Once you know how to set your classpath you can run the NanoSparqlServer from the command line by executing the class
com.bigdata.rdf.sail.webapp.NanoSparqlServer providing the connection port, the namespace and a property file:
java -cp ... -server com.bigdata.rdf.sail.webapp.NanoSparqlServer <port> <namespace> <propertiesFile>
The ... should be your classpath.
The port is just whatever http port you want to run on.
The namespace is the namespace of the triple or quads store instance within bigdata to which you want to connect. If no such namespace exists, a default kb instance is created.
The propertiesFile is where you configure bigdata. You can start with RWStore.properties and then edit it to match your requirements. There are a variety of example property files in samples for quads, triples, inference, provenance, and other interesting variations.
Embedded (using jetty)
The following code example starts a server from code - see NSSEmbeddedExample.java for the full example and running code.
server = NanoSparqlServer.newInstance(port, indexManager, initParams); server.start(); final int actualPort = server.getConnectors()[0] .getLocalPort(); String hostAddr = NicUtil.getIpAddress("default.nic", "default", true/* loopbackOk */); if (hostAddr == null) { hostAddr = "localhost"; } final String serviceURL = new URL("http", hostAddr, actualPort, ""/* file */) .toExternalForm(); System.out.println("serviceURL: " + serviceURL); // Block and wait. The NSS is running. server.join();
Servlet Container (Tomcat, jetty, etc)
Download WAR
Download, install, configure a servlet container. See the documentation for your server container as they are all different.
Download [the latest bigdata.war file]. Alternatively you can build the bigdata.war file:
ant clean bundleJar war
This generates ant-build/bigdata.war.
Drop the WAR into the webapps directory of your servlet container and unpack it.
Build jetty deployer
Alternatively you can build the deployer for jetty. This approach may be used for both HA and non-HA deployments. It produces a directory structure that is suitable for installation as a service. The web.xml, jetty.xml, log4j.properties and related files are all located within the generated directory structure. See HAJournalServer for details on the structure and configuration of the generated distribution.
ant stage
Note: It is strongly advised that you unpack the WAR before you start it and edit the RWStore.properties and/or the web.xml deployment descriptor. The web.xml file controls the location of the RWStore.properties file. The RWStore.properties file controls the behavior of the bigdata database instance, the location of the database instance on your disk, and the configuration for the default triple and/or quad store instance that will be created when the webapp starts for the first time. Take a moment to review and edit web.xml and RWStore.properties before you go any further. See GettingStarted if you need help to setup the KB for triples versus quads, enable inference, etc.
Note: As of r6797 and releases after 1.2.2, you can specify the following property to override the location of the bigdata property file:
where FILE is the fully qualified path of the bigdata property file (e.g., RWStore.properties).
You should specify JAVA_OPTS with at least the following properties. The guidelines for the maximum java heap size are no more than 1/2 of the available RAM. Heap sizes of 2G to 8G are good recommended to avoid long GC pauses. Larger heaps are possible with the G1 collector (in Java 7).
export JAVA_OPTS="-server -Xmx2g"
A log4j.properties file is deployed to the WEB-INF/classes directory in the WAR. This will be located automatically during startup. Releases through 1.0.2 will log a warning indicating that the log4j configuration could not be located, but the log4j.properties file is still in effect.
By default, the log4j.properties file will log on the ConsoleAppender. You can edit the log4j.properties file to specify a different appender, e.g., a FileAppender and log file.
You can override the log4j.properties file with your own version by passing a Java property at the command line.
-Dlog4j.configuration={path to file}
Common Startup Problems
The default web.xml and RWStore.properties files use path names which are relative to the directory in which you start the servlet engine. To use the defaults for those files with tomcat you must start tomcat from the 'bin' directory. For example:
cd bin ./startup.sh
If you have any problems getting the bigdata WAR to start, please consult the servlet log files for detailed information which can help you to localize a configuration error. For Tomcat6 on Ubuntu 10.04 the servlet log is called /var/lib/tomcat6/logs/catalina.out . It may have another name or location in another environment. If you see a permissions error on attempting to open file rules.log then your servlet engine may have been started from the wrong directory.
If you cannot start Tomcat from the 'bin' directory as described above, then you can instead change bigdata's file paths from relative to absolute:
- In webapps/bigdata/WEB-INF/RWStore.properties change this line:
- In webapps/bigdata/WEB-INF/classes/log4j.properties change these three lines:
- In webapps/bigdata/WEB-INF/web.xml change this line:
Active URLs
When deployed normally, the following URLs should be active (make sure you use the correct port# for your servlet engine):
- http://localhost:8080/bigdata - help page / console. (This is also called the serviceURL.)
- http://localhost:8080/bigdata/sparql - REST API (This is also called the SparqlEndpoint and uses the default namespace.)
- http://localhost:8080/bigdata/status - Status page
- http://localhost:8080/bigdata/counters - Performance counters
For example, you can select everything in the database using (this will be an empty result set for a new quad store):
http://localhost:8080/bigdata/sparql?query=select * where { ?s ?p ?o } limit 1
URL encoded this would be:
The following context-param entries are defined. Also see HAJournalServer and HALoadBalancer.
|The property file (for a standalone database instance) or the jini configuration file (for a federation). The file MUST end with either ".properties" or ".config". This path is relative to the directory from which you start the servlet container so you may have to edit it for your installation, e.g., by specifying an absolution path. Also, it is a good idea to review the RWStore.properties file as well and specify the location of the database file on which it will persist your data. Note: You MAY override this parameter using "-Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile=FILE" when starting the servlet container.
|The default bigdata namespace of for the triple or quad store instance to be exposed.
|When true a new triple or quads store instance will be created if none is found at that namespace.
|The size of the thread pool used to service SPARQL queries -OR- ZERO (0) for an unbounded thread pool (which is not recommended).
|When true, the REST API will not permit mutation operations.
|When non-zero, the timeout for queries (milliseconds).
|When non-zero, the timeout for the warmup period (milliseconds). The warmup period pulls in the non-leaf index pages and reduces the impact of sudden heavy query workloads on the disk and on GC. The end points are not available during the warmup period.
|A list of the namespaces to be exercised during the warmup period (optional). When the list is empty, all namespaces will be warmed up.
|The number of parallel threads to use for the warmup period. At most one thread will be used per index.
Highly Available Replication Cluster (HA)
See HAJournalServer for information on deploying the HA Replication Cluster.
Scale-out (cluster / federation)
The NanoSparqlServer will automatically create a KB instance for given namespace if none exists. However, the default KB configuration is not appropriate for scale-out. In order to create a KB instance which is appropriate for scale-out you need to override the properties object which will be seen by the NanoSparqlServer (actually, by the BigdataRDFServletContext). You can do this by editing "com.bigdata.service.jini.JiniClient" component block in the configuration file. The line that you want to change is:
old: // properties = new NV[] {}; new: properties = lubm.properties;
This will direct the NanoSparqlServer to use the configuration for the KB instance described the the "lubm" component in the file, which gives a KB configuration which is appropriate for the LUBM benchmark. You can then modify the "lubm" component to reflect your use case, e.g., triples versus quads, etc.
To setup for quads, change the following lines in the "lubm" configuration block:
old: static private namespace = "U"+univNum+""; new: static private namespace = "PUT-YOUR_NAMESPACE_HERE"; // Note: This MUST be the same value you will specify to the NanoSparqlServer. old: //new NV(BigdataSail.Options.AXIOMS_CLASS, "com.bigdata.rdf.axioms.RdfsAxioms"), new: new NV(BigdataSail.Options.AXIOMS_CLASS,"com.bigdata.rdf.axioms.NoAxioms"), new: new NV(BigdataSail.Options.QUADS_MODE,"true"), old: new NV(BigdataSail.Options.FORWARD_CHAIN_OWL_INVERSE_OF, "true"), new NV(BigdataSail.Options.FORWARD_CHAIN_OWL_TRANSITIVE_PROPERTY, "true"), new: // new NV(BigdataSail.Options.FORWARD_CHAIN_OWL_INVERSE_OF, "true"), // new NV(BigdataSail.Options.FORWARD_CHAIN_OWL_TRANSITIVE_PROPERTY, "true"),
Note that you have to specify the namespace both in the configuration file and on the command line and to the NanoSparqlServer since the configuration file is parametrized to override various indices based on the namespace.
Start the NanoSparqlServer using
nanoSparqlServer.sh. You need to specify the port and the default KB namespace on the command line:
nanoSparqlServer.sh port namespace
The NanoSparqlServer will echo the serviceURL to the console. The actual URL depends on your installation, but it will be something like this:
serviceURL: http://192.168.1.10:8090/bigdata
The "serviceURL" is actually the URI of the NanoSparqlServer web application. You can interact directly with the web application. If you want to use the SPARQL end point, you need to append "/sparql" to that URL. For example:
serviceURL: http://192.168.1.10:8090/bigdata/sparql
Note: By default, the nanoSparqlServer.sh script will assert a read lock for the lastCommitTime on the federation. This removes the need to obtain a transaction per query on a cluster. See the script file for more information.
- log4j configuration complaints.
- reload of the webapp causes complaints.
- refer people to JVM settings for decent performance.
SPARQL End Point
The NanoSparqlServer will respond at the following URL
A request to the following URL will result in a permanent redirect (301) to the URL given above:
The baseURI for the NanoSparqlServer is the effective service end point URL.
MIME Types
In general, requests may use any of the known MIME types. Likewise, you can CONNEG for any of these MIME types. However, CONNEG may not be very robust. Therefore, when seeking a specific MIME type for a response, it is best to specify an Accept header which specifies just the desired MIME type.
RDF data
These data are based on the
org.openrdf.rio.RDFFormat declarations. The set of understood formats is extensible Additional declarations MAY be registered with the openrdf platform and associated with parsers and writers for that RDFFormat. The recommended charset, file name extension, etc. are always as declared by the IANA MIME type registration. Note that a potential for confusion exists with the ".xml" MIME Type and its use with this API is not recommended. RDR means that both RDF* and SPARQL* are supported for a given data interchange syntax. See Reification_Done_Right for more details.
|MIME Type
|File extension
|.rdf, .rdfs, .owl, .xml
|N-Triples defines an escape encoding for non-ASCII characters.
|This is a bigdata specific extension of N-TRIPLES that supports RDR.
|This is a bigdata specific extension that supports RDR.
|Parser only before bigdata 1.4.0.
|application/sparql-results+json, application/json
|.srj, .json
|Bigdata JSON interchange for RDF/RDF*
|bigdata json interchange supports RDF RDR data and also SPARQL result sets.
SPARQL Result Sets
|MIME Type
|SPARQL Query Results XML Format
|application/sparql-results+json, application/json
|SPARQL Query Results JSON Format
|The bigdata extension allows the interchange of RDR data in result sets as well.
|Binary Query Results Format
|This is a format defined by the openrdf platform.
|Tab Separated Values (TSV)
|Comma Separated Values (CSV)
Property set data
The Multi-Tenancy API interchanges property set data. The MIME types understood by the API are:
|MIME Type
|File extension
Mutation Result
Operations which cause a mutation will report an XML document having the general structure:
<data modified="5" milliseconds="112"/>
Where modified is the mutation count.
Where milliseconds is the elapsed time for the operation.
API Atomicity
Queries use snapshot isolation.
Mutation operations are ACID against a standalone database and shard-wise ACID against a bigdata federation.
API Parameters
Some operations accept parameters that MUST be URIs. Others accept parameters that MAY be either Literals or URIs. Where either a literal or a URI value can be used, as in the s, p, o, and c parameters for DELETE or ESTCARD, then angle brackets (for a URI) or quoting (for a Literal) MUST be used. Otherwise, angle brackets and quoting MUST NOT be used.
URI Only Value Parameters
If an operation accepts a parameter that MUST be a URI, then the URI is given without the surrounding angle brackets < >. This is true for all SPARQL and SPARQL 1.1 query and update URI parameters.
For example, the following method inserts the data from tbox.ttl into the context named <http://example.org/tbox>. The
context-uri MUST be a URI. The angle brackets are NOT used.
curl -D- -H 'Content-Type: text/turtle' --upload-file tbox.ttl \ -X POST 'http://localhost:80/bigdata/sparql?context-uri=http://example.org/tbox'
URI or Literal Valued Parameters
If an operation accepts parameters that MAY be either a URI or a Literal, then the value MUST be specified using angle brackets or quotes as appropriate. For these parameters, the quotation marks and angle brackets are necessary to distinguish between values that are Literals and values that are URIs. Without this, the API could not distinguish between a Literal whose text was a well-formed URI and a URI.
Examples of properly formed URIs and Literals include:
<http://www.bigdata.com/> "abc" "abc"@en "3"^^xsd:int
A number of the bigdata REST API methods can operate on Literals or URIs. The following example will delete all triples in the named graph <http://example.org/graph1>. The angle brackets MUST be used since the DELETE methods allow you to specify the s (subject), p (predicate) o (object), or c (context) for the triple or quad pattern to be deleted. Since the pattern may include both URIs and Literals, Literals MUST be quoted and URIs MUST use angle brackets:
curl -D- -X DELETE 'http://localhost:80/bigdata/sparql?c=<http://example.org/graph1>'
Some REST API methods (e.g., DELETE_BY_ACCESS_PATH) allow multiple bindings for the context position. Such bindings are distinct URL query parameters. For example, the following removes all statements in the named graph <http://example.org/graph1> and the named graph <http://example.org/graph2>.
curl -D- -X DELETE 'http://localhost:80/bigdata/sparql?c=<http://example.org/graph1>&c=<http://example.org/graph2>'
GET or POST
GET Request-URI ?query=... -OR- POST Request-URI ?query=...
The response body is the result of the query.
The following query parameters are understood:
|A timestamp corresponding to a commit time against which the query will read.
|The query will be run, but the response will be an HTML document containing an "explanation" of the query. The response currently includes the original SPARQL query, the operator tree obtained by parsing that query, and detailed metrics from the evaluation of the query. This information may be used to examine opportunities for query optimization.
|This enables the AnalyticQuery mode.
|Specify zero or more graphs whose RDF merge is the default graph for this query (protocol option with the same semantics as FROM).
|Specify zero or more named graphs for this query (protocol option with the same semantics as FROM NAMED).
|Available in versions after 1.4.0. This is an optional query parameter that allows you to set the result type other than via the Accept Headers. Valid values are json, xml, application/sparql-results+json, and application/sparql-results+xml. json and xml are simple short cuts for the full mime type specification. Setting this parameter will override any Accept Header that is present.
The following HTTP headers are understood:
|The maximum time in milliseconds for the query to execute.
For example, the following simple query will return one statement from the default KB instance:
curl -X POST http://localhost:8080/bigdata/sparql \ --data-urlencode 'query=SELECT * { ?s ?p ?o } LIMIT 1' -H 'Accept:application/rdf+xml'
If you want the result set in JSON using Accept headers, use:
curl -X POST http://localhost:8080/bigdata/sparql \ --data-urlencode 'query=SELECT * { ?s ?p ?o } LIMIT 1' -H 'Accept:application/sparql-results+json'
If you want the result set in JSON using the format query parameter, use:
curl -X POST http://localhost:8080/bigdata/sparql \ --data-urlencode 'query=SELECT * { ?s ?p ?o } LIMIT 1' --data-urlencode 'format=json'
If cached results are Ok, then you can use an HTTP GET instead:
curl -G http://localhost:8080/bigdata/sparql \ --data-urlencode 'query=SELECT * { ?s ?p ?o } LIMIT 1' -H 'Accept:application/sparql-results+json'
Bigdata uses fast range counts internally for its query optimizer. Fast range counts on an access path are computed with two key probes against appropriate index. Fast range counts are appropriate for federated query engines where they provide more information than an "ASK" query for a triple pattern. Fast range counts are also exact range counts under some common deployment configurations.
Fast range counts are fast. They use two key probes to find the ordinal index of the from and to key for the access path and then report (toIndex-fromIndex). This is orders of magnitude faster than you can achieve in SPARQL using a construction like "SELECT COUNT (*) { ?s ?p ?o }" because the corresponding SPARQL query must actually visit each tuple in that key range, rather than just reporting how many tuples there are.
Fast range counts are exact when running against a BigdataSail on a local journal which has been provisioned without full read/write transactions. When full read/write transactions are enabled, the fast range counts will also report the "delete markers" in the index. In scale-out, the fast range counts are also approximate if the key range spans more than one shard (in which case you are talking about lot of data).
Note: This method is available in releases after version 1.0.2.
GET Request-URI ?ESTCARD&([s|p|o|c]=(uri|literal))+
uri and
literal use the SPARQL syntax for fully specified URI and literals, as per #URI_or_Literal_Valued_Parameters e.g.,
<http://www.bigdata.com/> "abc" "abc"@en "3"^^xsd:int
The quotation marks and angle brackets are necessary to distinguish between values that are Literals and values that are URIs.
The response is an XML document having the general structure:
<data rangeCount="5" milliseconds="12"/>
Where rangeCount is the mutation count.
Where milliseconds is the elapsed time for the operation.
For example, this will report a fast estimated range count for all triples or quads in the default KB instance:
curl -G -H 'Accept: application/xml' 'http://localhost:8080/bigdata/sparql' --data-urlencode ESTCARD
While this example will only report the fast range count for all triples having the specified subject URI:
curl -G -H 'Accept: application/xml' 'http://localhost:8080/bigdata/sparql' \ --data-urlencode ESTCARD --data-urlencode 's=<http://www.w3.org/People/Berners-Lee/card#i>'
INSERT RDF (POST with Body)
POST Request-URI ... Content-Type: ... BODY
Perform an HTTP-POST, which corresponds to the basic CRUD operation "create" according to the generic interaction semantics of HTTP REST.
Where BODY is the new RDF content using the representation indicated by the Content-Type.
You can also specify a context-uri request parameter which sets the default context when triples data are loaded into a quads store (available in releases after 1.0.2).
For example, the following command will POST the local file 'data-1.nq' to the default KB.
curl -X POST -H 'Content-Type:text/x-nquads' --data-binary '@data-1.nq' http://localhost:8080/bigdata/sparql
INSERT RDF (POST with URLs)
POST Request-URI ?uri=URI
Where URI identifies a resource whose RDF content will be inserted into the database. The uri query parameter may occur multiple times. All identified resources will be loaded in a single operation. See [1] for the mime types understood by this operation.
You can also specify a context-uri request parameter which sets the default context when triples data are loaded into a quads store (available in releases after 1.0.2).
For example, the following command will load the data from the specified URI into the default KB instance. For this command, the uri parameter must be a resource that can be resolved by the server that will execute the INSERT operation. Typically, this means either a public URL or a URL for a file in the local file system on the server.
curl -X POST --data-binary 'uri=file:///Users/bryan/Documents/workspace/BIGDATA_RELEASE_1_2_0/bigdata-rdf/src/resources/data/foaf/data-0.nq' http://localhost:8080/bigdata/sparql
DELETE with Query
DELETE Request-URI ?query=...
Where query is a CONSTRUCT or DESCRIBE query.
Note: The QUERY + DELETE operation is ACID.
DELETE with Body (using POST)
POST Request-URI ?delete ... Content-Type ... BODY
This is a POST because many APIs do not allow a BODY with a DELETE verb. The BODY contains RDF statements according to the specified Content-Type. Statements parsed from the BODY are deleted.
DELETE with Access Path
Note: This method is available in releases after version 1.0.2.
DELETE Request-URI ?([s|p|o|c]=(uri|literal))+
uri and
literal use the SPARQL syntax for fully specified URI and literals, as per #URI_or_Literal_Valued_Parameters e.g.,
<http://www.bigdata.com/> "abc" "abc"@en "3"^^xsd:int
The quotation marks and angle brackets are necessary to distinguish between values that are Literals and values that are URIs.
All statements matching the bound values of the subject (s), predicate (p), object (o), and/or context (c) position will be deleted from the database. Each position may be specified at most once, but more than one position may be specified. For example:
So, a DELETE of everything for a given context would be:
DELETE Request-URI ?c=<http://example.org/foo>
And a DELETE of everything for some subject and predicate would be:
DELETE Request-URI ?s=<http://example.org/s1>&p=<http://www.example.org/p1>
And to DELETE everything having some object value:
DELETE Request-URI ?o="abc"
DELETE Request-URI ?o="5"^^<datatypeUri>
And to delete everything at that end point:
DELETE Request-URI
For example, the following will delete all statements with the specified subject in the default KB instance.
CAUTION: This curl command is tricky. If you specify just -x DELETE without the --get then it will ignore the ?s parameter and remove EVERYTHING in the default KB instance!
curl --get -X DELETE -H 'Accept: application/xml' 'http://localhost:8080/bigdata/sparql' --data-urlencode 's=<http://www.w3.org/People/Berners-Lee/card#i>'
POST Request-URI ?update=...
|Specify zero or more graphs whose RDF merge is the default graph for the update request (protocol option with the same semantics as USING).
|Specify zero or more named graphs for this the update request (protocol option with the same semantics as USING NAMED).
See SPARQL 1.1 Protocol.
Note: This method is available in releases after version 1.1.0.
For example, the following SPARQL 1.1 UPDATE request would drop all existing statements in the default KB instance and then load data into the default KB from the specified URL:
curl -X POST http://localhost:8080/bigdata/sparql --data-urlencode 'update=DROP ALL; LOAD <file:/Users/bryan/Documents/workspace/BIGDATA_RELEASE_1_2_0/bigdata-rdf/src/resources/data/foaf/data-0.nq.gz>;'
UPDATE (DELETE statements selected by a QUERY plus INSERT statements from Request Body using PUT)
PUT Request-URI ?query=... ... Content-Type ... BODY
Where query is a CONSTRUCT or DESCRIBE query.
Note: The QUERY + DELETE operation is ACID.
Note: You MAY specify a CONSTRUCT query with an empty WHERE clause in order to specify a set of statements to be removed without reference to statements already existing in the database. For example:
CONSTRUCT { bd:Bryan bd:likes bd:RDFS } { }
Note the trailing "{ }" which is the empty WHERE clause. This makes it possible to delete arbitrary statements followed by the insert of arbitrary statements.
|Request parameter which sets the default context when triples data are loaded into a quads store (available in releases after 1.0.2).
UPDATE (POST with Multi-Part Request Body)
POST Request-URI ?updatePost ... Content-Type: multipart/form-data; boundary=... ... form-data; name="remove" Content-Type: ... Content-Body ... form-data; name="add" Content-Type: ... Content-Body ... BODY
You can specify two sets of serialized statements - one to be removed and one to be added. This operation will be ACID on the server.
|Request parameter which sets the default context when triples data are loaded into a quads store (available in releases after 1.0.2).
GET /status
Various information about the SPARQL end point. URL Query parameters include:
|Show information on all queries currently executing on the NanoSparqlServer. The queries will be arranged in descending order by their elapsed evaluation time. When the value of this query parameter is "details", the response will include the query evaluation metrics for each bop (bigdata operator) in the query. Otherwise only the query evaluation metrics for the top-level query bop in the query plan will be included. In either case, the reported metrics are updated each time the page is refreshed so it is possible to track the progress of a long running query in this manner.
|Request information only for the specified query(s). This parameter may appear zero or more times. (Since bigdata 1.1).
For the default namespace:
POST /bigdata/sparql/?cancelQuery&queryId=....
For a caller specified namespace:
POST /bigdata/namespace/sparql/?cancelQuery&queryId=....
Cancel one or more running query(s). Queries which are still running when the request is processed will be cancelled. (Since bigdata 1.1. Prior to bigdata 1.2, this method was available at
/status. The preferred URI for this method is now the URI of the SPARQL end point. The
/status URI is deprecated for this method.)
See the queryId QueryHint.
|The UUID of a running query.
For example, for the default namespace:
curl -X POST http://localhost:8091/bigdata/sparql --data-urlencode 'cancelQuery' --data-urlencode 'queryId=a7a4b8e0-2b14-498c-94ab-9d79caddb0f6'
For a caller specified namespace:
curl -X POST http://localhost:8091/bigdata/namespace/kb/sparql --data-urlencode 'cancelQuery' --data-urlencode 'queryId=a7a4b8e0-2b14-498c-94ab-9d79caddb0f6'
Multi-Tenancy API
The Multi-Tenancy API allows you to administer and access multiple triple or quad store instances in a single backing Journal or Federation. Each triple or quad store instance has a unique namespace and corresponds to the concept of a VoID Dataset. A brief VoID description is used to describe the known data sets. A detailed VoID description is included in the Service Description of a data set. The default data set is associated with the namespace "kb" (unless you override that on the NanoSparqlServer command line). The SPARQL end point for a data set may be used to obtain a detailed Service Description of that data set (including VoID metadata and statistics), to issue SPARQL 1.1 Query and Update requests, etc. That end point is:
where NAMESPACE is the namespace of the desired data set.
This feature is available in bigdata releases after 1.2.2.
GET /bigdata/namespace
Obtain a brief VoID description of the known data sets. The description includes the namespace of the data set and its sparql end point. A more detailed service description is available from the sparql end point. The response to this request MAY be cached.
For example:
curl localhost:8090/bigdata/namespace
POST /bigdata/namespace ... Content-Type ... BODY
Where BODY contains the properties used to the create the namespace. The content type indicates whether the properties are in xml or text NanoSparqlServer#Property_set_data. (See NanoSparqlServer#Quads or NanoSparqlServer#Triples + Inference + Truth Maintenance below).
HTTP/1.1 201 Created Content-Type: text/plain; charset=ISO-8859-1 Location: http://localhost:8080/bigdata/namespace/NAMESPACE/sparql Content-Length: ... CREATED: NAMESPACE
Status codes (since 1.3.2)
|Status Code
|Conflict (Namespace exists).
The Location header in the response provides a URL for the newly created SPARQL end point. This URL may be used to obtain a service description, issue queries, issue updates, etc.
Create a new data set (aka a KB instance). The data set is configured based on the inherited configuration properties as overridden by the properties specified in the request entity (aka the BODY). The Content-Type must be one of those recognized for Java properties (the supported MIME Types are specified at NanoSparqlServer#Property_set_data).
You MUST specify at least the following property in order to create a non-default data set:
where NAMESPACE is the name of the new data set.
See the javadoc for the BigdataSail and AbstractTripleStore for other configuration options. Also see the sample property files in bigdata-sails/src/samples.
Note: You can not reconfigure the Journal or Federation using this method. The properties will only be applied to the newly created data set. This method does NOT create a new backing Journal, it just creates a new data set on the same Journal (or on the same Federation when running on a cluster).
For example:
curl -v -X POST --data-binary @tmp.xml --header 'Content-Type:application/xml' http://localhost:8090/bigdata/namespace
where tmp.xml is patterned after one of the examples below. Be sure to replace MY_NAMESPACE with the namespace of the KB instance that you want to create. The new KB instance will inherit any defaults specified when the backing Journal or Federation was created. You can override any inherited properties by specifying a new value for that property with the request.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <!-- --> <!-- NEW KB NAMESPACE (required). --> <!-- --> <entry key="com.bigdata.rdf.sail.namespace">MY_NAMESPACE</entry> <!-- --> <!-- Specify any KB specific properties here to override defaults for the BigdataSail --> <!-- AbstractTripleStore, or indices in the namespace of the new KB instance. --> <!-- --> <entry key="com.bigdata.rdf.store.AbstractTripleStore.quads">true</entry> </properties>
Triples + Inference + Truth Maintenance
To setup a KB that supports incremental truth maintenance use the following properties.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <!-- --> <!-- NEW KB NAMESPACE (required). --> <!-- --> <entry key="com.bigdata.rdf.sail.namespace">MY_NAMESPACE</entry> <!-- --> <!-- Specify any KB specific properties here to override defaults for the BigdataSail --> <!-- AbstractTripleStore, or indices in the namespace of the new KB instance. --> <!-- --> <entry key="com.bigdata.rdf.store.AbstractTripleStore.quads">false</entry> <entry key="com.bigdata.rdf.store.AbstractTripleStore.axiomsClass">com.bigdata.rdf.axioms.OwlAxioms</entry> <entry key="com.bigdata.rdf.sail.truthMaintenance">true</entry> </properties>
GET /bigdata/namespace/NAMESPACE/properties
Obtain a list of the effective configuration properties for the data set named NAMESPACE.
For example, retrieve the configuration for a specified KB in either the text/plain or XML format.
curl --header 'Accept: text/plain' http://localhost:8090/bigdata/namespace/kb/properties curl --header 'Accept: application/xml' http://localhost:8090/bigdata/namespace/kb/properties
DELETE /bigdata/namespace/NAMESPACE
Destroy the data set identified by NAMESPACE.
For example:
curl -X DELETE http://localhost:8090/bigdata/namespace/kb
Transaction Management
This section is under development. We will be exposing support for sequences of read/write operations that are isolated by a common transaction through the REST API in 1.5.2. See http://trac.bigdata.com/ticket/1156 for details.
Choosing the right transaction model
Blazegraph supports two basic transaction models: unisolated and isolated. This choice is made on a namespace by namespace basis, but it may be defaulted for the Journal. To isolated operations specify the following option for a namespace.
- Unisolated operations write on the live index objects. This option provides better scalability and better throughput because the unisolated transaction does not need to buffer its write set. The mutations are simply applied to the indices. If the transaction commits, the indices are checkpointed. If the transaction aborts, then write set is discarded.
- Isolated operations rely on a fused view of the indices. An isolating index is established by the transaction in front of each index on which it needs to write. Mutations are written onto the isolating index. The writes are initially buffered in memory, but they will spill onto the disk for large transactions. When the transaction prepares, the write set is validated against the then current state of the unisolated indices. If there are no write conflicts, or if all conflicts can be reconciled, then the transaction can commit. Otherwise it must abort. Note that blazegraph does not support truth maintenance for namespaces that use isolated operations.
Note: Query always using snapshot isolation regardless of which transaction model you choose. These read-only views are completely non-blocking which is why blazegraph has such good performance for concurrent query. Since all queries have snapshot isolation, creating an explicit read-only transaction is only useful when more than one query needs to be run against the same commit point and there are concurrent writes on the database. Further, creating an explicit transaction incurs significant overhead due to the additional messages (CREATE-TX, QUERY, ABORT-TX) vs (QUERY).
Note: Transactions are scoped to the database, not the namespace. Thus a transaction MAY be used to coordinate operations across multiple namespaces.
Note: Open transactions pin the commit point on which the transaction is reading. Thus, long running transactions can prevent recycling.
Group Commit and Transactions
Group commit allows multiple write sets associated with different isolated or unisolated transactions to be melded into a single commit point. Group commit relies on a heirarchical locking scheme to serialize unisolated mutation operations for the same namespace. If isolated operations are being used, then group commit does not come into play until the transaction attempts to commit.
High Availability and Transactions
Each HAJournalServer has a local transaction manager. These transaction managers do not interchange messages as transactions are created and destroyed. This is key to achieving perfect linear scaling in query throughput as a function of the size of the replication cluster. During the 2-phase ACID commit, the nodes in the quorum communicate to identify the new consensus around the release time during the commit protocol. This consensus release time is used to decide which commit points are pinned and which can be recycled.
Transactions created on one node are NOT also registered on the other nodes. Further, the protocol for resynchronization of a node does not consider resynchronization of the transaction manager state since all transaction managers are completely independent. Thus, transactions created on a given HAJournalServer may be used on that HAJournalServer but are not visible on other HAJournalServer instances. However, commit times are the same for all nodes and all nodes will have a consensus about the release time so a commit time that is pinned on the leader (by a transaction) will be visible on the other nodes as well. Thus, the client can create a transaction (CREATE-TX) on the leader and use the readsOnCommitTime reported for that transaction to load balance queries across all nodes in the replication cluster. Those reads will have snapshot isolation in terms of the commit point pinned by the transaction until the transaction is either aborted (ABORT-TX) or committed (COMMIT-TX).
The practical impact is:
- Clients MUST use the leader to coordinate transactions (CREATE-TX, PREPARE-TX, IS-ACTIVE-TX, COMMIT-TX, ABORT-TX). - Transaction identifiers (txId values) are created and managed by the leader. These txIds are NOT visible to the followers. - Mutation operations isolated by a transaction MUST be directed to the leader (this is the same when transactions are not used - only the leader accepts writes). - The readsOnCommitTime (see CREATE-TX) MAY be used to load balance read operations across the leader and followers (see above for details). - Transactions break if there is a leader failover event or quorum break
Scale-out and Transactions
Mutation operations in scale-out are shard-wise ACID and use the unisolated connection internally. Mutations are typically applied using an eventually consistent model. If the update fails, it is reapplied.
Scale-out supports snapshot isolation for query. The recommended pattern is to periodically update a global read lock to pin a globally consistent commit point. Queries are then issued against the commit time associated with the read lock. This removes the (significant) overhead of coordination with the transaction service in scale-out on a per-query basis.
Transaction Management API
This API is only required for isolated operations where the client wishes to have the life cycle of a transaction span multiple client operations (for example, more than one query, more than one update, or some combination of queries and updates). In this case, the client follows a pattern:
POST /bigdata/tx => txId doWork(txId).... POST /bigdata/tx/txid?COMMIT
Note: GET is not allowed for most transaction management methods to defeat http caching.
Response Entity
The general form of the response entity is an XML document having the following structure:
<xml ><response elapsed="..." ><tx txId="..." readsOnCommitTime="..." readOnly="true|false" /></xml>
The response entity is an XML document. Depending on the operation there may be one or more than one tx elements in the request. For example, LIST-TX reports all active transactions.
The attributes of the response element are as follows:
|The elapsed time (milliseconds) to process the request on the server.
The attributes of the tx element are as follows:
|The transaction identifier. This must be used with the transaction API.
|The timestamp associated with the commit point on which the transaction is reading. This commit point (and all more recent commit points) are pinned by the transaction until it either aborts or commits.
|"true" if the transaction is read-only and "false" if the transaction allows mutation.
Note: Either the txId or the readsOnCommitTime may be used for the ×tamp=... parameter on the REST API methods. However, in a Highly Available replication cluster the readsOnCommitTime MAY be used to load balance read operations across the cluster while only the leader will be able to interpret the txId.
Obtain a list of active transactions.
GET /bigdata/tx
For example:
curl localhost:8090/bigdata/tx
A typical response:
HTTP/1.1 200 Ok Location: http://localhost:8080/bigdata/tx/txId Content-Type: application/xml Content-Length: ... <xml ><tx txId="..." readsOnCommitTime="..." readOnly="true|false" ><tx txId="..." readsOnCommitTime="..." readOnly="true|false" ><tx txId="..." readsOnCommitTime="..." readOnly="true|false" ><tx txId="..." readsOnCommitTime="..." readOnly="true|false" ><tx txId="..." readsOnCommitTime="..." readOnly="true|false" /></xml>
Return a new transaction identifier.
POST /bigdata/tx(?timestamp=TIMESTAMP)
The timestamp parameter is a long (64-bit) integer. It meaning is defined as follows and defaults to 0 (UNISOLATED). Note that 0 corresponds to ITx.UNISOLATED and -1 corresponds to ITx.READ_COMMITTED. See ITransactionService for more details on the semantics of these symbolic constants.
|This requests a new read/write transaction. The transaction will read on the last commit point on the database at the time that the transaction was created. This is the default behavior if the timestamp parameter is not specified. Note: The federation architecture (aka scale-out) does NOT support distributed read/write transactions - all mutations in scale-out are shard-wise ACID.
|This requests a new read-only transaction. The transaction will read on the last commit point on the database at the time that the transaction was created.
|This requests a new read-only transaction. The operation will be executed against the most recent committed state whose commit timestamp is less than or equal to timestamp.
A typical response is below. Note that the Location header will include the URI for the transaction while the transaction identifier is given in the response entity. The response entity is an XML document as defined above.
HTTP/1.1 201 Created Location: http://localhost:8080/bigdata/tx/txId Content-Type: application/xml Content-Length: ... <xml><tx txId="..." readsOnCommitTime="..." readOnly="true|false"/></xml>
Status codes
|Status Code
|Bad request if the TIMESTAMP is a negative value other than -1 (READ_COMMITTED).
Obtain status about the transaction. Note that committed and aborted transactions may no longer exist on the server.
POST /bigdata/tx/txId?STATUS
Status codes
|Status Code
|The transaction was found on the server.
|The transaction was not found on the server.
The response entity is an XML document as defined above.
Aborts the transaction. The write set of the transaction (if any) is discarded. The transaction is no longer active.
POST /bigdata/tx/txId?ABORT
Status codes
|Status Code
|The transaction was aborted.
|The transaction was not found on the server.
The response entity is an XML document as defined above.
Returns true is the write set of the transaction passes validation. If it does not pass validation, then a COMMIT-TX message will fail and the transaction must be aborted by the client.
POST /bigdata/tx/txId?PREPARE
Status codes
|Status Code
|The transaction was validated.
|The transaction was not found on the server.
|Validation failed for the transaction.
The response entity is an XML document as defined above.
Prepares and commits the transaction. This message first performs validation. If validation is not successful, then the transaction can not be committed and a failure message is retturn. If the transaction was successfully validated, then it is melded into the next commit group and a success message is returned. Once the transaction commits it is no longer active.
POST /bigdata/tx/txId?COMMIT
Status codes
|Status Code
|The transaction was validated and committed.
|The transaction was not found on the server.
|Validation failed for the transaction.
The response entity is an XML document as defined above.
TODO Define the post-condition of PREPARE when the transaction fails validation (has the transaction write set been discarded? Is the transaction aborted?) Update the client IRemoteTx API and implementation to be in compliance with these post-condition definitions.
TODO Document redo patterns for the client when a transaction fails validation (and write tests for those patterns).
TODO Update the "Java Client API" section per the javadoc at BigdataSailRemoteRepository. Do this when we merge back to the master.
TODO Update the TxGuide. That page is really about internals and concepts. Have it point to this section?
TODO Scale-out does not report the readsOnCommitTime per trac #266. This is making the internal API a bit cumbersome. Consider reporting as -1L for scale-out until #266 is resolved and documenting this in the API.
TODO Introduce a timeout for transactions? Open transactions pin the commit point on which they read. If a client accidentally leaves open a transaction (e.g., by dying or becoming disconnected from the server) then recycling will be disabled. Transactions without ongoing client activity should probably be timed out. Also, it may make sense to impose a timeout on transactions and to allow the client to request a timeout allocation when it creates the transaction.
TODO Add an age attribute to the XML response entity for the tx element. This would make it possible to identify the longest running transactions. The readsOnCommitTime can identify the earliest pinned commit point, but this is not really the same. For example, all transactions against a read-only end point (and why would you bother ...) could have the same readsOnCommitTime if they read on the same commit point while some could have been open for days and others only milliseconds. The Tx class does not currently record when a transaction is created, but this could be changed easily enough.
Java Client API
We have added a Java API for clients to the NanoSparqlServer. The main REST API is contained in the class:
And the test case "com.bigdata.rdf.sail.webapp.TestNanoSparqlClient" demonstrates how to use the API.
The Multi-Tenancy API is contained in the class:
See JettyHttpClient for more details about the jetty client integration.
Query Optimization
There are several ways to get information about running query evaluation plans.
- The #STATUS page has a showQueries=(details) option which provides in depth information about the SPARQL query, Abstract Syntax Tree, bigdata operators (bops) and running statistics on current queries.
- The #QUERY ?explain parameter may be used with a query to report essentially the same information as the #STATUS page in an HTML response.
Performance Optimization resources
- There is a also good write up on query performance optimization on the blog [2].
- There is a section on performance optimization for bigdata on the wiki PerformanceOptimization.
- Bigdata supports a variety of query hints through both the SAIL and the NanoSparqlServer interfaces. See [3] for more details.
- Bigdata supports query hints using magic triples (since 1.1.0). See QueryHints.


text:
AnastasiaDate, the dating service for singles seeking a European match, has revealed that members are very attracted to dating those matches who know more than one language. AnastasiaDate has an amazing reputation as an international dating website due to some of the best features for easy virtual dating and a membership comprising singles from across the world. The global membership of AnastasiaDate has been steadily increasing partly due to the initiatives they take to ensure members have a great dating experience.
Those who speak a language other than their native tongue are often regarded as more open-minded and adaptable, which is one reason why singles are attracted to such matches. Singles are more attracted to members fluent in a second language as it often means they have a number of desirable qualities. Such individuals are perceived as having a better willingness to understand other cultures.
The international dating website is an exciting platform for singles to meet across the world, bringing together many different cultures and languages in one place. AnastasiaDate believes that love knows no boundaries and this is proven everyday by singles who come together from across the world.
Knowledge of an additional language makes communication more fun for online couples from diverse geographical backgrounds. It significantly improves the chances of getting closer in a new relationship as there is a better chance of hitting it off.
AnastasiaDate has a large number of members registered with the ability to speak more than one language. While English is the most commonly used and popular language on AnastasiaDate, other languages such as Spanish, Russian, French, Ukrainian, and German are also popular.
The international dating website is the perfect place for those who only speak one language or are hoping to learn another. They offer an instant translation service to members to ensure that communication is smooth and satisfying. AnastasiaDate also provides language learning lessons in the form of Virtual Gifts. It is a great way of encouraging singles to learn another language.
AnastasiaDate members can connect with compatible singles registered on the dating website using a wide range of features including Live Chat, CamShare and CallMe.
For more information, visit AnastasiaDate.
About AnastasiaDate:
AnastasiaDate is the leading international dating service that facilitates exciting and romantic companionship between men and women all over the world. Founded in 1993, AnastasiaDate now has over 20 million international users and attracts more than 80 million visitors annually. Additionally, over 1.5 million conversations are exchanged onsite daily. AnastasiaDate is committed to member safety, customer satisfaction and the ongoing pursuit of innovation. Part of the Social Discovery Ventures network, AnastasiaDate is headquartered in New York with additional representation in every country it touches, providing a high level of customer service to a worldwide clientele. All members are able to communicate across a variety of top-notch multimedia platforms, including video chat and a mobile app for Android devices available in Google Play.
Media Contact
Company Name: AnastasiaDate
Contact Person: Media Relations
Email: firstname.lastname@example.com
Phone: +1 (212) 609-0533
Country: United States
Website: http://www.AnastasiaDate.com


text:
United held at Turf Moor
Louis van Gaal's problems mounted at Turf Moor as Angel di Maria hobbled off injured in Manchester United's uninspiring 0-0 draw with Burnley.
Van Gaal, who watched his team get hammered by MK Dons in midweek, stretched his winless streak to four matches after another poor display - this time at the home of Barclays Premier League newcomers Burnley, who were torn apart here by Chelsea on the opening weekend of the season.
Robin van Persie's second-half shot was cleared off the line, but otherwise United had very few chances despite the fact that they had the Holland striker, Di Maria, Rooney and Juan Mata on the pitch for most of the match.
Record signing Angel Di Maria was substituted on 70 minutes for Manchester United
Jonny Evans and Antonio Valencia were guilty of making potentially costly defensive errors and David de Gea also had to make a few impressive saves to deny the Clarets, who picked up their first point of the campaign.
Until he went off, Di Maria was by far United's best player.
The British record signing speared a number of long passes from deep, but Van Persie and Rooney both had off days up front and could not convert, and his pace caused problems too.
The sight of the former Real Madrid man hobbling off clutching his right leg in the second half will be a concern for Van Gaal, who paid £59.7million for the Argentina international four days ago.
United announced they had agreed a fee with Ajax for Daley Blind before kick-off, but, on this evidence, it will take much more than one new player to reinvigorate the Red Devils.
Di Maria, playing in a midfield three alongside Mata and a slightly deeper Darren Fletcher, received a hero's welcome from the away fans as he took to the pitch, but he was marginalised early on as Burnley took control from the off.
With less than three minutes gone, United handed the hosts a good chance to score and they almost took it. Phil Jones barged over Lukas Jutkiewicz to earn a free-kick right on the edge of the box.
David Jones beat De Gea with a curling effort from the resulting set-piece, but the ball struck the bar and bounced out to safety.
Soon after Burnley were gifted their second opportunity when Evans, in an almost identical error to the one he committed at MK Dons on Tuesday, sold De Gea short with a backpass, but the Spaniard came out to block Jutkiewicz's shot.
Di Maria then produced his first bit of magic to spark United into life. The Argentinian lofted a 40-yard ball over the top of the home defence and Van Persie cushioned the ball perfectly on his chest, but he mis-hit his volley.
De Gea was called into action again, racing out of his box to clear just in time after a defensive mix-up as Burnley continued to look the more dangerous side.
De Gea parried a swirling volley from Jones shortly after watching Scott Arfield head over from close range.
Any hopes of a United goal seemed to rest on Di Maria's shoulders. The former Real Madrid midfielder kept the Burnley back four on their toes with his pace and trickery on the attack and he was also proving effective from deep.
Di Maria picked out Rooney with another long diagonal ball. The United and England captain prodded the ball to Van Persie, but Jason Shackell intervened.
Fletcher, looking increasingly isolated in midfield, was booked for tugging Danny Ings' shirt.
United started to come into the game a bit more towards the end of the first half. Ashley Young went down in the box under pressure from Kieran Trippier, but Chris Foy waved play on.
After a dull opening five minutes of the second half, United created a couple of good chances, but once again they could not find the net.
Dean Marney saved Van Persie's shot on the line after a good run from Di Maria. The Dutchman spurned another chance soon after, heading Fletcher's chipped pass onto the roof of the net.
Then came a sight no United fan wanted to see - Di Maria down on the floor holding his right leg. The player got back to his feet after treatment, but moments later Van Gaal took his record signing off and replaced him with Anderson.
It was a move that showed just how desperately short United are on quality.
Van Persie was then replaced by Danny Welbeck up front.
United's lack of concentration at the back remained Van Gaal's biggest worry, though.
Valencia carelessly played the ball straight to the unmarked Arfield on the edge of his own box, but he failed to beat De Gea.
At the other end Mata, who was having a day to forget, ploughed the ball high and wide and the Spaniard came off for Adnan Januzaj with four minutes to go.
In the dying stages United thought they should have had a penalty when Young's shot appeared to hit Ashley Barnes' arm, but Foy was not interested and the game petered out into a draw.
Sorry we are not currently accepting comments on this article.