Building Web Applications with Python and Neo4j 1st Edition Sumit Gupta instant download
Building Web Applications with Python and Neo4j 1st Edition Sumit Gupta instant download
https://ebookname.com/product/building-web-applications-with-
python-and-neo4j-1st-edition-sumit-gupta/
https://ebookname.com/product/building-web-apps-with-
wordpress-1st-edition-brian-messenlehner/
https://ebookname.com/product/building-web-services-with-
microsoft-azure-1st-edition-belotserkovskiy/
https://ebookname.com/product/homogeneous-catalysis-mechanisms-
and-industrial-applications-2nd-edition-sumit-bhaduri/
https://ebookname.com/product/nutrition-immunity-and-infection-
first-edition-prakash-shetty/
Design for Motion Fundamentals and Techniques of Motion
Design Austin Shaw
https://ebookname.com/product/design-for-motion-fundamentals-and-
techniques-of-motion-design-austin-shaw/
https://ebookname.com/product/the-encyclopedia-of-skin-and-skin-
disorders-facts-on-file-library-of-health-and-living-3rd-edition-
carol-turkington/
https://ebookname.com/product/tables-of-knowledge-descartes-in-
vermeer-s-studio-harriet-stone/
https://ebookname.com/product/gilles-deleuze-1st-edition-claire-
colebrook/
https://ebookname.com/product/teaching-intercultural-rhetoric-
and-technical-communication-theories-curriculum-pedagogies-and-
practice-1st-edition-barry-thatcher/
Pick Your Yoga Practice Exploring and Understanding
Different Styles of Yoga 1st Edition Meagan Mccrary
https://ebookname.com/product/pick-your-yoga-practice-exploring-
and-understanding-different-styles-of-yoga-1st-edition-meagan-
mccrary/
Building Web Applications
with Python and Neo4j
Sumit Gupta
BIRMINGHAM - MUMBAI
Building Web Applications with Python and Neo4j
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78398-398-8
www.packtpub.com
Credits
Commissioning Editor
Kunal Parikh Indexer
Rekha Nair
Acquisition Editor
Larissa Pinto Production Coordinator
Aparna Bhagat
Technical Editors
Novina Kewalramani
Ryan Kochery
Manal Pednekar
About the Author
Adarsh Deshratnam is a senior consultant (big data and cloud) whose focus is
on designing, developing, and deploying Hadoop solutions for many MNCs. In
this position, he has worked with customers to build several Hadoop applications
with multiple database technologies, providing a unique perspective on moving
customers beyond batch processing. An avid technologist, he focuses on technological
innovations. Since 2006, he has been working full time and part time with big data and
multiple database technologies. Adarsh completed his engineering at Staffordshire
University with a computing major.
Gianluca Tiepolo has been programming since Windows 3.11 was around.
As a cofounder of Sixth Sense Solutions, a start-up that is a global leader in retail
solutions, he has worked with some of the world's biggest brands to deliver engaging,
interactive experiences to their customers. He specializes in high-performance
implementations of database services and computer vision. Currently, he's deeply
involved in the open source community and has a lot of interest in big data.
Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at service@packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
TM
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser
[i]
Table of Contents
[ ii ]
Table of Contents
[ iii ]
Table of Contents
[ iv ]
Preface
Relational databases have been one of the most widely used and most common
forms of software systems for the storage of data since the 1970s. They are highly
structured and store data in the form of tables, that is, with rows and columns.
Structuring and storing data in the form of rows and columns has its own
advantages; for example, it is easier to understand and locate data, reduce data
redundancy by applying normalization, maintain data integrity, and much more.
Mike, John, and Claudia are friends. Claudia is married to Wilson. Mike and Wilson
work for the same company.
Here is one of the possible ways to structure this data in a relational database:
[v]
Preface
We should remember that relationships are evolving, and will evolve over a period
of time. There could be new relationships, or there could be changes to existing
relationships.
We can design a better structure but in any case, wouldn't that be forcibly fitting the
model into a structure?
RDBMS is good for use cases where the relationship between entities is more or less
static and does not change over a period of time. Moreover, the focus of RDBMS is
more on the entities and less on the relationships between them.
There could be many more examples where RDBMS may not be the right choice:
1. Model and store 7 billion people objects and 3 billion non-people objects to
provide an "earth view" drill-down from the planet to a sidewalk
2. Network management
3. Genealogy
4. Public transport links and road maps
[ vi ]
Preface
Although there is no single definition of graphs, here is the simplest one (http://
en.wikipedia.org/wiki/Graph_(abstract_data_type)), which helps us to
understand the theory of graphs:
A graph data structure consists of a finite (and possibly mutable) set of nodes or
vertices, together with a set of ordered pairs of these nodes (or, in some cases, a set
of unordered pairs). These pairs are known as edges or arcs. As in mathematics,
an edge (x,y) is said to point or go from x to y. The nodes may be part of the graph
structure, or may be external entities represented by integer indices or references.
Neo4j, as an open source graph database, is part of the NoSQL family, and provides
a flexible data structure, where the focus is on the relationships between the entities
rather than the entities themselves.
Its first version (1.0) was released in February 2010, and since then, it has never
stopped. It is amazing to see the pace at which Neo4J has evolved over the years. At
the time of writing this book, the stable version was 2.2.RC01, which was released in
March 2015.
If you are reading this book, then you probably already have sufficient knowledge
about graph databases and Python. You will appreciate their contribution to the
complex world of relationships.
Let's move forward and jump into the nitty-gritty of developing web applications
with Python and Neo4j.
In the subsequent chapters, we will cover the various aspects dealing with data
modelling, programming, and data analysis by means of application development
with Python and Neo4j. We will cover the concepts of working with py2neo, Django,
flask, and many more.
[ vii ]
Preface
Chapter 2, Querying the Graph with Cypher, starts by explaining Cypher as a graph
query language for Neo4j, and then we take a deep dive into the various Cypher
constructs to perform read operations. This chapter also talks about the importance
of patterns and pattern matching, and their usage in Cypher with various real-world
and easy-to-understand examples.
Chapter 3, Mutating Graph with Cypher, starts by covering the Cypher constructs
used to perform write operations on the Neo4j database. This chapter further talks
about creating relationships between nodes and discusses the constraints required
for maintaining the integrity of data. At the end, it discuss about the performance
tuning of Cypher queries using various optimization techniques.
Chapter 4, Getting Python and Neo4j to Talk Py2neo, introduces Py2neo as a Python
framework for working with Neo4j. This chapter explores various Python APIs
exposed by Py2neo for working with Neo4j. It also talks about batch imports
and introduces a social network use case, which is created and unit tested by
using Py2neo APIs.
Chapter 5, Build RESTful Service with Flask and Py2neo, talks about building web
applications and the integration of Flask and Py2neo. This chapter starts with the
basics of Flask as a framework for exposing ReSTful APIs, and further talks about
the Py2neo extension OGM (short for Object Graph Mapper) and its integration with
Flask for performing various CRUD and search operations on the social network use
case by creating and leveraging various ReST endpoints.
Chapter 6, Using Neo4j with Django and Neomodel, starts by describing Neomodel as
an ORM for Neo4j. It discusses various high-level APIs exposed by Neomodel to
perform CRUD and search operations using Python APIs or by directly executing
Cypher queries. Finally, it talks about integration of two of the popular Python
frameworks, Django and Neomodel.
[ viii ]
Preface
If you are reading this book, then you probably already have sufficient knowledge
of Python. This book will cover data modelling, programming, and data analysis by
means of application development with Python and Neo4j. It will cover concepts
such as working with py2neo, Django, flask, and so on.
Conventions
In this book, you will find a number of text styles that distinguish between different
kinds of information. Here are some examples of these styles and an explanation of
their meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"We can include other contexts through the use of the include directive."
New terms and important words are shown in bold. Words that you see on the
screen, for example, in menus or dialog boxes, appear in the text like this: "Now,
click on the star sign in the panel on the extreme left-hand side, and click on
Create a node in the provided menu."
[ ix ]
Preface
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or disliked. Reader feedback is important for us as it
helps us develop titles that you will really get the most out of.
If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide at www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things
to help you to get the most from your purchase.
[x]
Preface
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in the text or
the code—we would be grateful if you could report this to us. By doing so, you can
save other readers from frustration and help us improve subsequent versions of this
book. If you find any errata, please report them by visiting http://www.packtpub.
com/submit-errata, selecting your book, clicking on the Errata Submission Form
link, and entering the details of your errata. Once your errata are verified, your
submission will be accepted and the errata will be uploaded to our website or added
to any list of existing errata under the Errata section of that title.
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all
media. At Packt, we take the protection of our copyright and licenses very seriously.
If you come across any illegal copies of our works in any form on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.
We appreciate your help in protecting our authors and our ability to bring you
valuable content.
Questions
If you have a problem with any aspect of this book, you can contact us at
questions@packtpub.com, and we will do our best to address the problem.
[ xi ]
Chapter 1
This chapter will help you to understand the paradigm, applicability, various
aspects, and characteristics of Neo4j as a graph database. It will guide you through
the installation process, starting right from downloading and running your first
Cypher query leveraging various interfaces/tools/utilities exposed by Neo4j
against your fully-working instance.
At the end of this chapter, your work environment will be fully functional, and
you will be able to write your first Cypher query to insert/fetch the data from the
Neo4j database.
[1]
Your First Query with Neo4j
The relational models are schema-oriented. If you know the structure of data
in advance, it is easy to ensure that data conforms to it, and at the same time, it
helps in enforcing stronger integrity. Some examples include traditional business
applications, such as flight reservations, payroll, order processing, and many more.
Let's briefly discuss the disadvantages of the SQL databases, which led to the
evolution of the graph databases:
All the preceding reasons were sufficient to design a different data structure, and as
a result, the graph data structures were introduced.
The objective of the graph databases was specifically to meet the disadvantages
of the SQL databases. However, Neo4j as a graph database, also leveraged the
advantages of the SQL databases wherever possible and applicable. Let's see a
few of the similarities between the SQL and graph databases:
• Highly Consistent: At any point in time, all nodes contain the same data at
the same time
• Transactional: All insert or update operations are within a transaction where
they are ACID
Having said that, it is not wrong to say that the graph databases are more or less the
next generation of relational databases.
[2]
Chapter 1
Neo4j leveraged the concept of patterns and pattern matching, and introduced a new
declarative graph query language, Cypher, for the Neo4j graph database. Patterns
and pattern matching are the essence and core of Neo4j, so let's take a moment to
understand them. We will then talk about the similarities between SQL and Cypher.
Patterns are a given sequence or occurrence of tokens in a particular format. The act
of matching patterns within a given sequence of characters or any other compatible
input form is known as pattern matching. Pattern matching should not be confused
with pattern recognition, which usually produces the exact match and does not have
any concept of partial matches.
Pattern matching is the heart of Cypher and a very important component of the
graph databases. It helps in searching and identifying a single or a group of nodes
by walking along the graph. Refer to http://en.wikipedia.org/wiki/Pattern_
matching for more information on the importance of pattern matching in graphs.
Let's move forward and talk about Cypher, and it's similarities with SQL.
Cypher borrows much of its structure from SQL, which makes it easy to use/
understand for SQL developers. "SQL familiarity" is another objective of Cypher.
[3]
Your First Query with Neo4j
Let's refer to the following illustration, which defines the Cypher constructs and the
similarity of Cypher with SQL constructs:
The preceding diagram defines the mapping of the common SQL and Cypher
constructs. It also depicts the examples stating the usage of these constructs.
For instance, FROM is similar to MATCH or START and produces the same results.
Although the way they are used is different but the objective and concept remains
the same.
We will talk about Cypher in detail in Chapter 2, Querying the Graph with Cypher and
Chapter 3, Mutating Graph with Cypher, but without getting into the nitty-gritty and
syntactical details. The following is one more illustration that briefly describes the
similarities between the Cypher and SQL constructs:
[4]
Another Random Document on
Scribd Without Any Related Topics
Leighton and Coleridge.
Leighton.
What though the polite man count thy fashion a little odd and too
precise, it is because he knows nothing above that model of
goodness which he hath set himself, and therefore approves of
nothing beyond it: he knows not God, and therefore doth not discern
and esteem what is most like Him. When courtiers come down into
the country, the common home-bred people possibly think their
habit strange; but they care not for that, it is the fashion at court.
What need, then, that Christians should be so tender-foreheaded, as
to be put out of countenance because the world looks on holiness as
a singularity? It is the only fashion in the highest court, yea, of the
King of Kings himself.
APHORISM XVIII.
Superficial Reconciliations, and Self-deceit in Forgiving.
Leighton.
APHORISM XIX.
Of the Worth and the Duties of the Preacher.
Leighton.
APHORISM XX.
Leighton.
Comment.
On an Intermediate State, or State of Transition from Morality to
Spiritual Religion.
This Aphorism would, it may seem, have been placed more fitly in
the Chapter following. In placing it here, I have been determined by
the following convictions: 1. Every state, and consequently that
which we have described as the state of Religious Morality, which is
not progressive, is dead, or retrograde. 2. As a pledge of this
progression, or, at least, as the form in which the propulsive
tendency shows itself, there are certain Hopes, Aspirations,
Yearnings, that, with more or less of consciousness, rise and stir in
the Heart of true Morality as naturally as the sap in the full-formed
stem of a rose flows towards the bud, within which the flower is
maturing. 3. No one, whose own experience authorizes him to
confirm the truth of this statement, can have been conversant with
the volumes of religious biography, can have perused (for instance)
the lives of Cranmer, Ridley, Latimer, Wishart, Sir Thomas More,
Bernard Gilpin, Bishop Bedel, or of Egede, Swartz, and the
missionaries of the frozen world, without an occasional conviction,
that these men lived under extraordinary influences, which in each
instance and in all ages of the Christian æra bear the same
characters, and both in the accompaniments and the results
evidently refer to a common origin. And what can this be? is the
question that must needs force itself on the mind in the first
moment of reflection on a phenomenon so interesting and
apparently so anomalous. The answer is as necessarily contained in
one or the other of two assumptions. These influences are either the
Product of Delusion (insania amabilis, and the re-action of
disordered nerves), or they argue the existence of a relation to some
real agency, distinct from what is experienced or acknowledged by
the world at large, for which as not merely natural on the one hand,
and yet not assumed to be miraculous[55] on the other, we have no
apter name than spiritual. Now if neither analogy justifies nor the
moral feelings permit the former assumption, and we decide
therefore in favour of the reality of a State other and higher than the
mere Moral Man, whose Religion[56] consists in Morality, has attained
under these convictions, can the existence of a transitional state
appear other than probable? or that these very convictions, when
accompanied by correspondent dispositions and stirrings of the
heart, are among the marks and indications of such a state? And
thinking it not unlikely that among the readers of this volume, there
may be found some Individuals, whose inward state, though
disquieted by doubts and oftener still perhaps by blank misgivings,
may, nevertheless, betoken the commencement of a Transition from
a not irreligious Morality to a Spiritual Religion, with a view to their
interests I placed this Aphorism under the present head.
APHORISM XXI.
Leighton.
APHORISM XXII.
Knowledge not the ultimate End of Religious Pursuits.
APHORISM XXIII.
The sum of Church History.
Leighton.
APHORISM XXIV.
Worthy to be framed and hung up in the Library of every
Theological Student.
Leighton and Coleridge.
APHORISM XXV.
He, who begins by loving Christianity better than Truth, will
proceed by loving his own Sect or Church better than Christianity,
and end in loving himself better than all.
APHORISM XXVI.
The Absence of Disputes, and a general Aversion to Religious
Controversies, no proof of True Unanimity.
APHORISM XXVII.
The Influence of Worldly Views (or what are called a Man's
Prospects in Life), the Bane of the Christian Ministry.
Leighton
It is a base, poor thing for a man to seek himself; far below that
royal dignity that is here put upon Christians, and that priesthood
joined with it. Under the Law, those who were squint-eyed were
incapable of the priesthood: truly, this squinting toward our own
interest, the looking aside to that, in God's affairs especially, so
deforms the face of the soul, that it makes it altogether unworthy
the honour of this spiritual priesthood. Oh! this is a large task, an
infinite task. The several creatures bear their part in this; the sun
says somewhat, and moon and stars, yea, the lowest have some
share in it; the very plants and herbs of the field speak of God; and
yet, the very highest and best, yea all of them together, the whole
concert of Heaven and earth, cannot show forth all His praise to the
full. No, it is but a part, the smallest part of that glory, which they
can reach.
APHORISM XXVIII.
Despise none: Despair of none.
Leighton.
The Jews would not willingly tread upon the smallest piece of
paper in their way, but took it up; for possibly, said they, the name
of God may be on it. Though there was a little superstition in this,
yet truly there is nothing but good religion in it, if we apply it to
men. Trample not on any; there may be some work of grace there,
that thou knowest not of. The name of God may be written upon
that soul thou treadest on; it may be a soul that Christ thought so
much of, as to give His precious blood for it; therefore despise it not.
APHORISM XXIX.
Men of Least Merit most apt to be Contemptuous, Because most
Ignorant and most Overweening of Themselves.
Leighton.
Too many take the ready course to deceive themselves; for they
look with both eyes on the failings and defects of others, and
scarcely give their good qualities half an eye, while on the contrary,
in themselves, they study to the full their own advantages, and their
weaknesses and defects, (as one says), they skip over, as children
do their hard words in their lesson, that are troublesome to read;
and making this uneven parallel, what wonder if the result be a
gross mistake of themselves!
APHORISM XXX.
Vanity may strut in rags, and Humility be arrayed in purple and
fine linen.
Leighton.
APHORISM XXXI.
Of the Detraction among Religious Professors.
Leighton and Coleridge.
APHORISM XXXII.
The Remedy.
Leighton.
All true remedy must begin at the heart; otherwise it will be but a
mountebank cure, a false imagined conquest. The weights and
wheels are there, and the clock strikes according to their motion.
Even he that speaks contrary to what is within him, guilefully
contrary to his inward conviction and knowledge, yet speaks
conformably to what is within him in the temper and frame of his
heart, which is double, a heart and a heart, as the Psalmist hath it:
Psalm xii. 2.
APHORISM XXXIII.
Leighton and Coleridge.
APHORISM XXXIV.
On the Passion for New and Striking Thoughts.
Leighton.
APHORISM XXXV.
The Radical Difference between the Good Man and the Vicious
Man.
The godly man hates the evil he possibly by temptation hath been
drawn to do, and loves the good he is frustrated of, and, having
intended, hath not attained to do. The sinner, who hath his
denomination from sin as his course, hates the good which
sometimes he is forced to do, and loves that sin which many times
he does not, either wanting occasion and means, so that he cannot
do it, or through the check of an enlightened conscience possibly
dares not do; and though so bound up from the act, as a dog in a
chain, yet the habit, the natural inclination and desire in him, is still
the same, the strength of his affection is carried to sin. So in the
weakest sincere Christian, there is that predominant sincerity and
desire of holy walking, according to which he is called a righteous
person, the Lord is pleased to give him that name, and account him
so, being upright in heart, though often failing.
Leighton adds, "There is a Righteousness of a higher strain." I do
not ask the reader's full assent to this position: I do not suppose him
as yet prepared to yield it. But thus much he will readily admit, that
here, if any where, we are to seek the fine Line which, like stripes of
Light in Light, distinguishes, not divides, the summit of religious
Morality from Spiritual Religion.
"A Righteousness" (Leighton continues) "that is not in him, but
upon him. He is clothed with it." This, reader! is the controverted
Doctrine, so warmly asserted and so bitterly decried under the name
of "imputed righteousness." Our learned Archbishop, you see, adopts it;
and it is on this account principally, that by many of our leading
Churchmen his orthodoxy has been more than questioned, and his
name put in the list of proscribed divines, as a Calvinist. That
Leighton attached a definite sense to the words above quoted, it
would be uncandid to doubt; and the general spirit of his writings
leads me to presume that it was compatible with the eternal
distinction between things and persons, and therefore opposed to
modern Calvinism. But what it was, I have not (I own) been able to
discover. The sense, however, in which I think he might have
received this doctrine, and in which I avow myself a believer in it, I
shall have an opportunity of showing in another place. My present
object is to open out the road by the removal of prejudices, so far at
least as to throw some disturbing doubts on the secure taking-for-
granted, that the peculiar Tenets of the Christian Faith asserted in
the articles and homilies of our National Church are in contradiction
to the common sense of mankind. And with this view, (and not in
the arrogant expectation or wish, that a mere ipse dixit should be
received for argument) I here avow my conviction, that the doctrine
of imputed Righteousness, rightly and scripturally interpreted, is so far
from being either irrational or immoral, that Reason itself prescribes
the idea in order to give a meaning and an ultimate object to
Morality; and that the Moral Law in the Conscience demands its
reception in order to give reality and substantive existence to the
idea presented by the Reason.
APHORISM XXXVI.
Leighton.
Comment.
Every rank of creatures, as it ascends in the scale of creation,
leaves death behind it or under it. The metal at its height of being
seems a mute prophecy of the coming vegetation, into a mimic
semblance of which it crystallizes. The blossom and flower, the acme
of vegetable life, divides into correspondent organs with reciprocal
functions, and by instinctive motions and approximations seems
impatient of that fixure, by which it is differenced in kind from the
flower-shaped Psyche, that flutters with free wing above it. And
wonderfully in the insect realm doth the Irritability, the proper seat
of Instinct, while yet the nascent Sensibility is subordinated thereto
—most wonderfully, I say, doth the muscular life in the insect, and
the musculo-arterial in the bird, imitate and typically rehearse the
adaptive Understanding, yea, and the moral affections and charities,
of man. Let us carry ourselves back, in spirit, to the mysterious
Week, the teeming Work-days of the Creator: as they rose in vision
before the eye of the inspired historian of the Generations of the
Heaven and the Earth, in the days that the Lord God made the Earth
and the Heavens.[57] And who that hath watched their ways with an
understanding heart, could, as the vision evolving, still advanced
towards him, contemplate the filial and loyal bee; the home-building,
wedded, and divorceless swallow; and above all the manifoldly
intelligent[58] ant tribes, with their Commonwealths and
Confederacies, their warriors and miners, the husbandfolk, that fold
in their tiny flocks on the honeyed leaf, and the virgin sisters, with
the holy instincts of maternal love, detached and in selfless purity—
and not say to himself, Behold the Shadow of approaching Humanity,
the Sun rising from behind, in the kindling Morn of Creation! Thus all
lower Natures find their highest Good in semblances and seekings of
that which is higher and better. All things strive to ascend, and
ascend in their striving. And shall man alone stoop? Shall his pursuits
and desires, the reflections of his inward life, be like the reflected
image of a tree on the edge of a pool, that grows downward, and
seeks a mock heaven in the unstable element beneath it, in
neighbourhood with the slim water-weeds and oozy bottom-grass
that are yet better than itself and more noble, in as far as
Substances that appear as Shadows are preferable to Shadows
mistaken for Substance! No! it must be a higher good to make you
happy. While you labour for any thing below your proper Humanity,
you seek a happy Life in the region of Death. Well saith the moral
poet—
Unless above himself he can
Erect himself, how mean a thing is man![59]
APHORISM XXXVII.
Leighton.
APHORISM XXXVIII.
Leighton.
APHORISM XXXIX.
Leighton.
Our condition is universally exposed to fears and troubles, and no
man is so stupid but he studies and projects for some fence against
them, some bulwark to break the incursion of evils, and so to bring
his mind to some ease, ridding it of the fear of them. Thus men seek
safety in the greatness, or multitude, or supposed faithfulness of
friends; they seek by any means to be strongly underset this way; to
have many, and powerful, and trust-worthy friends. But wiser men,
perceiving the unsafety and vanity of these and all external things,
have cast about for some higher course. They see a necessity of
withdrawing a man from externals, which do nothing but mock and
deceive those most who trust most to them; but they cannot tell
whither to direct him. The best of them bring him into himself, and
think to quiet him so; but the truth is, he finds as little to support
him there; there is nothing truly strong enough within him, to hold
out against the many sorrows and fears which still from without do
assault him. So then, though it is well done, to call off a man from
outward things, as moving sands, that he build not on them, yet,
this is not enough; for his own spirit is as unsettled a piece as is in
all the world, and must have some higher strength than its own, to
fortify and fix it. This is the way that is here taught, Fear not their
fear, but sanctify the Lord your God in your hearts; and if you can
attain this latter, the former will follow of itself.
APHORISM XL.
Worldly Troubles Idols.
Leighton.
APHORISM XLI.
On the right Treatment of Infidels.
[60] About the end of the same year (says Kalm), another of
these Animals (Mephitis Americana) crept into our cellar; but did
not exhale the smallest scent, because it was not disturbed. A
foolish old woman, however, who perceived it at night, by the
shining, and thought, I suppose, that it would set the world on
fire, killed it: and at that moment its stench began to spread.
We recommend this anecdote to the consideration of sundry old
women, on this side of the Atlantic, who, though they do not
wear the appropriate garment, are worthy to sit in their
committee-room, like Bickerstaff in the Tatler, under the canopy
of their grandam's hoop-petticoat.
APHORISM XLII.
Passion no Friend to Truth.
Leighton.
[61] To the same purpose are the two following sentences from
Hilary:
Etiam quæ pro Religione dicimus, cum grandi motu et disciplina
dicere debemus.—Hilarius de Trinit. Lib. 7.
Non relictus est hominum eloquiis de Dei rebus alius quam Dei
sermo.—Idem.
The latter, however, must be taken with certain qualifications and
exceptions; as when any two or more texts are in apparent
contradiction, and it is required to state a Truth that
comprehends and reconciles both, and which, of course, cannot
be expressed in the words of either,—for example, the filial
subordination (My Father is greater than I), in the equal Deity
(My Father and I are one).
APHORISM XLIII.
On the Conscience.
Leighton.
Comment.
What Conscience is, and that it is the ground and antecedent of
human (or self-) consciousness, and not any modification of the
latter, I have shown at large in a work announced for the press, and
described in the Chapter following.[62] I have selected the preceding
extract as an Exercise for Reflection; and because I think that in too
closely following Thomas à Kempis, the Archbishop has strayed from
his own judgment. The definition, for instance, seems to say all, and
in fact says nothing; for if I asked, How do you define the human
mind? the answer must at least contain, if not consist of, the words,
"a mind capable of Conscience." For Conscience is no synonime of
Consciousness, nor any mere expression of the same as modified by
the particular Object. On the contrary, a Consciousness properly
human (that is, Self-consciousness), with the sense of moral
responsibility, presupposes the Conscience, as its antecedent
condition and ground. Lastly, the sentence, "It is a fruitless verbal
debate," is an assertion of the same complexion with the
contemptuous sneers, at verbal criticism by the contemporaries of
Bentley. In questions of Philosophy or Divinity, that have occupied
the learned and been the subjects of many successive controversies,
for one instance of mere logomachy I could bring ten instances of
logodædaly, or verbal legerdemain, which have perilously confirmed
prejudices, and withstood the advancement of truth in consequence
of the neglect of verbal debate, that is, strict discussion of terms. In
whatever sense, however, the term Conscience may be used, the
following Aphorism is equally true and important. It is worth
noticing, likewise, that Leighton himself in a following page (vol. ii.
p. 97), tells us that a good Conscience is the root of a good
Conversation: and then quotes from St. Paul a text, Titus i. 15, in
which the Mind and the Conscience are expressly distinguished.
APHORISM XLIV.
The Light of Knowledge a necessary accompaniment of a Good
Conscience.
Leighton.
If you would have a good conscience, you must by all means have
so much light, so much knowledge of the will of God, as may
regulate you, and show you your way, may teach you how to do,
and speak, and think, as in His presence.
APHORISM XLV.
Yet the Knowledge of the Rule, though Accompanied by an
endeavour to accommodate our conduct to this Rule, will not of itself
form a Good Conscience.
Leighton.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com