/* * Copyright 2014, Stratio. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.stratio.deep.commons.utils; import static org.testng.Assert.*; import static org.testng.Assert.assertEquals; import java.math.BigDecimal; import java.sql.Timestamp; import java.util.*; import org.apache.spark.sql.Row; import org.apache.spark.sql.api.java.*; import org.apache.spark.sql.types.*; import org.json.simple.JSONValue; import org.testng.Assert; import org.testng.annotations.Test; import com.stratio.deep.commons.entity.Cell; import com.stratio.deep.commons.entity.Cells; import javax.activation.UnsupportedDataTypeException; public class CellsUtilsTest { @Test public void testGetJsonFromCell() throws Exception { } @Test public void testGetCellFromJson() throws Exception { String json = "{\"id\": \"TestDataSet\", \"metadata\": { \"author\": \"DANTE ALIGHIERI\", \"title\": \"THE DIVINE COMEDY\", \"source\": \"http://www.gutenberg.org/ebooks/8800\" }, \"cantos\": [ " + "{ \"canto\": \"I\", \"text\": \"His glory, by whose might all things are mov'd, Pierces the universe, and in one part Sheds more resplendence, elsewhere less. In heav'n, That largeliest of his light partakes, was I, Witness of things, which to relate again Surpasseth power of him who comes from thence; For that, so near approaching its desire Our intellect is to such depth absorb'd, That memory cannot follow. Nathless all, That in my thoughts I of that sacred realm Could store, shall now be matter of my song. Benign Apollo! this last labour aid, And make me such a vessel of thy worth, As thy own laurel claims of me belov'd. Thus far hath one of steep Parnassus' brows Suffic'd me; henceforth there is need of both For my remaining enterprise Do thou Enter into my bosom, and there breathe So, as when Marsyas by thy hand was dragg'd Forth from his limbs unsheath'd. O power divine! If thou to me of shine impart so much, That of that happy realm the shadow'd form Trac'd in my thoughts I may set forth to view, Thou shalt behold me of thy favour'd tree Come to the foot, and crown myself with leaves; For to that honour thou, and my high theme Will fit me. If but seldom, mighty Sire! To grace his triumph gathers thence a wreath Caesar or bard (more shame for human wills Deprav'd) joy to the Delphic god must spring From the Pierian foliage, when one breast Is with such thirst inspir'd. From a small spark Great flame hath risen: after me perchance Others with better voice may pray, and gain From the Cirrhaean city answer kind. Through diver passages, the world's bright lamp Rises to mortals, but through that which joins Four circles with the threefold cross, in best Course, and in happiest constellation set He comes, and to the worldly wax best gives Its temper and impression. Morning there, Here eve was by almost such passage made; And whiteness had o'erspread that hemisphere, Blackness the other part; when to the left I saw Beatrice turn'd, and on the sun Gazing, as never eagle fix'd his ken. As from the first a second beam is wont To issue, and reflected upwards rise, E'en as a pilgrim bent on his return, So of her act, that through the eyesight pass'd Into my fancy, mine was form'd; and straight, Beyond our mortal wont, I fix'd mine eyes Upon the sun. Much is allowed us there, That here exceeds our pow'r; thanks to the place Made for the dwelling of the human kind I suffer'd it not long, and yet so long That I beheld it bick'ring sparks around, As iron that comes boiling from the fire. And suddenly upon the day appear'd A day new-ris'n, as he, who hath the power, Had with another sun bedeck'd the sky. Her eyes fast fix'd on the eternal wheels, Beatrice stood unmov'd; and I with ken Fix'd upon her, from upward gaze remov'd At her aspect, such inwardly became As Glaucus, when he tasted of the herb, That made him peer among the ocean gods; Words may not tell of that transhuman change: And therefore let the example serve, though weak, For those whom grace hath better proof in store If I were only what thou didst create, Then newly, Love! by whom the heav'n is rul'd, Thou know'st, who by thy light didst bear me up. Whenas the wheel which thou dost ever guide, Desired Spirit! with its harmony Temper'd of thee and measur'd, charm'd mine ear, Then seem'd to me so much of heav'n to blaze With the sun's flame, that rain or flood ne'er made A lake so broad. The newness of the sound, And that great light, inflam'd me with desire, Keener than e'er was felt, to know their cause. Whence she who saw me, clearly as myself, To calm my troubled mind, before I ask'd, Open'd her lips, and gracious thus began: 'With false imagination thou thyself Mak'st dull, so that thou seest not the thing, Which thou hadst seen, had that been shaken off. Thou art not on the earth as thou believ'st; For light'ning scap'd from its own proper place Ne'er ran, as thou hast hither now return'd.' Although divested of my first-rais'd doubt, By those brief words, accompanied with smiles, Yet in new doubt was I entangled more, And said: 'Already satisfied, I rest From admiration deep, but now admire How I above those lighter bodies rise.' Whence, after utt'rance of a piteous sigh, She tow'rds me bent her eyes, with such a look, As on her frenzied child a mother casts; Then thus began: 'Among themselves all things Have order; and from hence the form, which makes The universe resemble God. In this The higher creatures see the printed steps Of that eternal worth, which is the end Whither the line is drawn. All natures lean, In this their order, diversely, some more, Some less approaching to their primal source. Thus they to different havens are mov'd on Through the vast sea of being, and each one With instinct giv'n, that bears it in its course; This to the lunar sphere directs the fire, This prompts the hearts of mortal animals, This the brute earth together knits, and binds. Nor only creatures, void of intellect, Are aim'd at by this bow; but even those, That have intelligence and love, are pierc'd. That Providence, who so well orders all, With her own light makes ever calm the heaven, In which the substance, that hath greatest speed, Is turn'd: and thither now, as to our seat Predestin'd, we are carried by the force Of that strong cord, that never looses dart, But at fair aim and glad. Yet is it true, That as ofttimes but ill accords the form To the design of art, through sluggishness Of unreplying matter, so this course Is sometimes quitted by the creature, who Hath power, directed thus, to bend elsewhere; As from a cloud the fire is seen to fall, From its original impulse warp'd, to earth, By vicious fondness. Thou no more admire Thy soaring, (if I rightly deem,) than lapse Of torrent downwards from a mountain's height. There would in thee for wonder be more cause, If, free of hind'rance, thou hadst fix'd thyself Below, like fire unmoving on the earth.' So said, she turn'd toward the heav'n her face.\" }, " + "{ \"canto\": \"II\", \"text\": \"All ye, who in small bark have following sail'd, Eager to listen, on the advent'rous track Of my proud keel, that singing cuts its way, Backward return with speed, and your own shores Revisit, nor put out to open sea, Where losing me, perchance ye may remain Bewilder'd in deep maze. The way I pass Ne'er yet was run: Minerva breathes the gale, Apollo guides me, and another Nine To my rapt sight the arctic beams reveal. Ye other few, who have outstretch'd the neck. Timely for food of angels, on which here They live, yet never know satiety, Through the deep brine ye fearless may put out Your vessel, marking, well the furrow broad Before you in the wave, that on both sides Equal returns. Those, glorious, who pass'd o'er To Colchos, wonder'd not as ye will do, When they saw Jason following the plough. The increate perpetual thirst, that draws Toward the realm of God's own form, bore us Swift almost as the heaven ye behold. Beatrice upward gaz'd, and I on her, And in such space as on the notch a dart Is plac'd, then loosen'd flies, I saw myself Arriv'd, where wond'rous thing engag'd my sight. Whence she, to whom no work of mine was hid, Turning to me, with aspect glad as fair, Bespake me: 'Gratefully direct thy mind To God, through whom to this first star we come.' Me seem'd as if a cloud had cover'd us, Translucent, solid, firm, and polish'd bright, Like adamant, which the sun's beam had smit Within itself the ever-during pearl Receiv'd us, as the wave a ray of light Receives, and rests unbroken. If I then Was of corporeal frame, and it transcend Our weaker thought, how one dimension thus Another could endure, which needs must be If body enter body, how much more Must the desire inflame us to behold That essence, which discovers by what means God and our nature join'd! There will be seen That which we hold through faith, not shown by proof, But in itself intelligibly plain, E'en as the truth that man at first believes. I answered: 'Lady! I with thoughts devout, Such as I best can frame, give thanks to Him, Who hath remov'd me from the mortal world. But tell, I pray thee, whence the gloomy spots Upon this body, which below on earth Give rise to talk of Cain in fabling quaint?' She somewhat smil'd, then spake: 'If mortals err In their opinion, when the key of sense Unlocks not, surely wonder's weapon keen Ought not to pierce thee; since thou find'st, the wings Of reason to pursue the senses' flight Are short. But what thy own thought is, declare.' Then I: 'What various here above appears, Is caus'd, I deem, by bodies dense or rare.' She then resum'd: 'Thou certainly wilt see In falsehood thy belief o'erwhelm'd, if well Thou listen to the arguments, which I Shall bring to face it. The eighth sphere displays Numberless lights, the which in kind and size May be remark'd of different aspects; If rare or dense of that were cause alone, One single virtue then would be in all, Alike distributed, or more, or less. Different virtues needs must be the fruits Of formal principles, and these, save one, Will by thy reasoning be destroy'd. Beside, If rarity were of that dusk the cause, Which thou inquirest, either in some part That planet must throughout be void, nor fed With its own matter; or, as bodies share Their fat and leanness, in like manner this Must in its volume change the leaves. The first, If it were true, had through the sun's eclipse Been manifested, by transparency Of light, as through aught rare beside effus'd. But this is not. Therefore remains to see The other cause: and if the other fall, Erroneous so must prove what seem'd to thee. If not from side to side this rarity Pass through, there needs must be a limit, whence Its contrary no further lets it pass. And hence the beam, that from without proceeds, Must be pour'd back, as colour comes, through glass Reflected, which behind it lead conceals. Now wilt thou say, that there of murkier hue Than in the other part the ray is shown, By being thence refracted farther back. From this perplexity will free thee soon Experience, if thereof thou trial make, The fountain whence your arts derive their streame. Three mirrors shalt thou take, and two remove From thee alike, and more remote the third. Betwixt the former pair, shall meet thine eyes; Then turn'd toward them, cause behind thy back A light to stand, that on the three shall shine, And thus reflected come to thee from all. Though that beheld most distant do not stretch A space so ample, yet in brightness thou Will own it equaling the rest. But now, As under snow the ground, if the warm ray Smites it, remains dismantled of the hue And cold, that cover'd it before, so thee, Dismantled in thy mind, I will inform With light so lively, that the tremulous beam Shall quiver where it falls. Within the heaven, Where peace divine inhabits, circles round A body, in whose virtue dies the being Of all that it contains. The following heaven, That hath so many lights, this being divides, Through different essences, from it distinct, And yet contain'd within it. The other orbs Their separate distinctions variously Dispose, for their own seed and produce apt. Thus do these organs of the world proceed, As thou beholdest now, from step to step, Their influences from above deriving, And thence transmitting downwards. Mark me well, How through this passage to the truth I ford, The truth thou lov'st, that thou henceforth alone, May'st know to keep the shallows, safe, untold. 'The virtue and motion of the sacred orbs, As mallet by the workman's hand, must needs By blessed movers be inspir'd. This heaven, Made beauteous by so many luminaries, From the deep spirit, that moves its circling sphere, Its image takes an impress as a seal: And as the soul, that dwells within your dust, Through members different, yet together form'd, In different pow'rs resolves itself; e'en so The intellectual efficacy unfolds Its goodness multiplied throughout the stars; On its own unity revolving still. Different virtue compact different Makes with the precious body it enlivens, With which it knits, as life in you is knit. From its original nature full of joy, The virtue mingled through the body shines, As joy through pupil of the living eye. From hence proceeds, that which from light to light Seems different, and not from dense or rare. This is the formal cause, that generates Proportion'd to its power, the dusk or clear.'\" }, " + "{ \"canto\": \"III\", \"text\": \"That sun, which erst with love my bosom warm'd Had of fair truth unveil'd the sweet aspect, By proof of right, and of the false reproof; And I, to own myself convinc'd and free Of doubt, as much as needed, rais'd my head Erect for speech. But soon a sight appear'd, Which, so intent to mark it, held me fix'd, That of confession I no longer thought. As through translucent and smooth glass, or wave Clear and unmov'd, and flowing not so deep As that its bed is dark, the shape returns So faint of our impictur'd lineaments, That on white forehead set a pearl as strong Comes to the eye: such saw I many a face, All stretch'd to speak, from whence I straight conceiv'd Delusion opposite to that, which rais'd Between the man and fountain, amorous flame. Sudden, as I perceiv'd them, deeming these Reflected semblances to see of whom They were, I turn'd mine eyes, and nothing saw; Then turn'd them back, directed on the light Of my sweet guide, who smiling shot forth beams From her celestial eyes. 'Wonder not thou,' She cry'd, 'at this my smiling, when I see Thy childish judgment; since not yet on truth It rests the foot, but, as it still is wont, Makes thee fall back in unsound vacancy. True substances are these, which thou behold'st, Hither through failure of their vow exil'd. But speak thou with them; listen, and believe, That the true light, which fills them with desire, Permits not from its beams their feet to stray.' Straight to the shadow which for converse seem'd Most earnest, I addressed me, and began, As one by over-eagerness perplex'd: 'O spirit, born for joy! who in the rays Of life eternal, of that sweetness know'st The flavour, which, not tasted, passes far All apprehension, me it well would please, If thou wouldst tell me of thy name, and this Your station here.' Whence she, with kindness prompt, And eyes glist'ning with smiles: 'Our charity, To any wish by justice introduc'd, Bars not the door, no more than she above, Who would have all her court be like herself. I was a virgin sister in the earth; And if thy mind observe me well, this form, With such addition grac'd of loveliness, Will not conceal me long, but thou wilt know Piccarda, in the tardiest sphere thus plac'd, Here 'mid these other blessed also blest. Our hearts, whose high affections burn alone With pleasure, from the Holy Spirit conceiv'd, Admitted to his order dwell in joy. And this condition, which appears so low, Is for this cause assign'd us, that our vows Were in some part neglected and made void.' Whence I to her replied: 'Something divine Beams in your countenance, wond'rous fair, From former knowledge quite transmuting you. Therefore to recollect was I so slow. But what thou sayst hath to my memory Given now such aid, that to retrace your forms Is easier. Yet inform me, ye, who here Are happy, long ye for a higher place More to behold, and more in love to dwell?' She with those other spirits gently smil'd, Then answer'd with such gladness, that she seem'd With love's first flame to glow: 'Brother! our will Is in composure settled by the power Of charity, who makes us will alone What we possess, and nought beyond desire; If we should wish to be exalted more, Then must our wishes jar with the high will Of him, who sets us here, which in these orbs Thou wilt confess not possible, if here To be in charity must needs befall, And if her nature well thou contemplate. Rather it is inherent in this state Of blessedness, to keep ourselves within The divine will, by which our wills with his Are one. So that as we from step to step Are plac'd throughout this kingdom, pleases all, E'en as our King, who in us plants his will; And in his will is our tranquillity; It is the mighty ocean, whither tends Whatever it creates and nature makes.' Then saw I clearly how each spot in heav'n Is Paradise, though with like gracious dew The supreme virtue show'r not over all. But as it chances, if one sort of food Hath satiated, and of another still The appetite remains, that this is ask'd, And thanks for that return'd; e'en so did I In word and motion, bent from her to learn What web it was, through which she had not drawn The shuttle to its point. She thus began: 'Exalted worth and perfectness of life The Lady higher up enshrine in heaven, By whose pure laws upon your nether earth The robe and veil they wear, to that intent, That e'en till death they may keep watch or sleep With their great bridegroom, who accepts each vow, Which to his gracious pleasure love conforms. from the world, to follow her, when young Escap'd; and, in her vesture mantling me, Made promise of the way her sect enjoins. Thereafter men, for ill than good more apt, Forth snatch'd me from the pleasant cloister's pale. God knows how after that my life was fram'd. This other splendid shape, which thou beholdst At my right side, burning with all the light Of this our orb, what of myself I tell May to herself apply. From her, like me A sister, with like violence were torn The saintly folds, that shaded her fair brows. E'en when she to the world again was brought In spite of her own will and better wont, Yet not for that the bosom's inward veil Did she renounce. This is the luminary Of mighty Constance, who from that loud blast, Which blew the second over Suabia's realm, That power produc'd, which was the third and last.' She ceas'd from further talk, and then began 'Ave Maria' singing, and with that song Vanish'd, as heavy substance through deep wave. Mine eye, that far as it was capable, Pursued her, when in dimness she was lost, Turn'd to the mark where greater want impell'd, And bent on Beatrice all its gaze. But she as light'ning beam'd upon my looks: So that the sight sustain'd it not at first. Whence I to question her became less prompt.\" }, " + "{ \"canto\": \"IV\", \"text\": \"Between two kinds of food, both equally Remote and tempting, first a man might die Of hunger, ere he one could freely choose. E'en so would stand a lamb between the maw Of two fierce wolves, in dread of both alike: E'en so between two deer a dog would stand, Wherefore, if I was silent, fault nor praise I to myself impute, by equal doubts Held in suspense, since of necessity It happen'd. Silent was I, yet desire Was painted in my looks; and thus I spake My wish more earnestly than language could. As Daniel, when the haughty king he freed From ire, that spurr'd him on to deeds unjust And violent; so look'd Beatrice then. 'Well I discern,' she thus her words address'd, 'How contrary desires each way constrain thee, So that thy anxious thought is in itself Bound up and stifled, nor breathes freely forth. Thou arguest; if the good intent remain; What reason that another's violence Should stint the measure of my fair desert? 'Cause too thou findst for doubt, in that it seems, That spirits to the stars, as Plato deem'd, Return. These are the questions which thy will Urge equally; and therefore I the first Of that will treat which hath the more of gall. Of seraphim he who is most ensky'd, Moses and Samuel, and either John, Choose which thou wilt, nor even Mary's self, Have not in any other heav'n their seats, Than have those spirits which so late thou saw'st; Nor more or fewer years exist; but all Make the first circle beauteous, diversely Partaking of sweet life, as more or less Afflation of eternal bliss pervades them. Here were they shown thee, not that fate assigns This for their sphere, but for a sign to thee Of that celestial furthest from the height. Thus needs, that ye may apprehend, we speak: Since from things sensible alone ye learn That, which digested rightly after turns To intellectual. For no other cause The scripture, condescending graciously To your perception, hands and feet to God Attributes, nor so means: and holy church Doth represent with human countenance Gabriel, and Michael, and him who made Tobias whole. Unlike what here thou seest, The judgment of Timaeus, who affirms Each soul restor'd to its particular star, Believing it to have been taken thence, When nature gave it to inform her mold: Since to appearance his intention is E'en what his words declare: or else to shun Derision, haply thus he hath disguis'd His true opinion. If his meaning be, That to the influencing of these orbs revert The honour and the blame in human acts, Perchance he doth not wholly miss the truth. This principle, not understood aright, Erewhile perverted well nigh all the world; So that it fell to fabled names of Jove, And Mercury, and Mars. That other doubt, Which moves thee, is less harmful; for it brings No peril of removing thee from me. 'That, to the eye of man, our justice seems Unjust, is argument for faith, and not For heretic declension. To the end This truth may stand more clearly in your view, I will content thee even to thy wish 'If violence be, when that which suffers, nought Consents to that which forceth, not for this These spirits stood exculpate. For the will, That will not, still survives unquench'd, and doth As nature doth in fire, tho' violence Wrest it a thousand times; for, if it yield Or more or less, so far it follows force. And thus did these, whom they had power to seek The hallow'd place again. In them, had will Been perfect, such as once upon the bars Held Laurence firm, or wrought in Scaevola To his own hand remorseless, to the path, Whence they were drawn, their steps had hasten'd back, When liberty return'd: but in too few Resolve so steadfast dwells. And by these words If duly weigh'd, that argument is void, Which oft might have perplex'd thee still. But now Another question thwarts thee, which to solve Might try thy patience without better aid. I have, no doubt, instill'd into thy mind, That blessed spirit may not lie; since near The source of primal truth it dwells for aye: And thou might'st after of Piccarda learn That Constance held affection to the veil; So that she seems to contradict me here. Not seldom, brother, it hath chanc'd for men To do what they had gladly left undone, Yet to shun peril they have done amiss: E'en as Alcmaeon, at his father's suit Slew his own mother, so made pitiless Not to lose pity. On this point bethink thee, That force and will are blended in such wise As not to make the' offence excusable. Absolute will agrees not to the wrong, That inasmuch as there is fear of woe From non-compliance, it agrees. Of will Thus absolute Piccarda spake, and I Of th' other; so that both have truly said.' Such was the flow of that pure rill, that well'd From forth the fountain of all truth; and such The rest, that to my wond'ring thoughts I found. 'O thou of primal love the prime delight! Goddess!' I straight reply'd, 'whose lively words Still shed new heat and vigour through my soul! Affection fails me to requite thy grace With equal sum of gratitude: be his To recompense, who sees and can reward thee. Well I discern, that by that truth alone Enlighten'd, beyond which no truth may roam, Our mind can satisfy her thirst to know: Therein she resteth, e'en as in his lair The wild beast, soon as she hath reach'd that bound, And she hath power to reach it; else desire Were given to no end. And thence doth doubt Spring, like a shoot, around the stock of truth; And it is nature which from height to height On to the summit prompts us. This invites, This doth assure me, lady, rev'rently To ask thee of other truth, that yet Is dark to me. I fain would know, if man By other works well done may so supply The failure of his vows, that in your scale They lack not weight.' I spake; and on me straight Beatrice look'd with eyes that shot forth sparks Of love celestial in such copious stream, That, virtue sinking in me overpower'd, I turn'd, and downward bent confus'd my sight.\" }, " + "{ \"canto\": \"V\", \"text\": \"'If beyond earthly wont, the flame of love Illume me, so that I o'ercome thy power Of vision, marvel not: but learn the cause In that perfection of the sight, which soon As apprehending, hasteneth on to reach The good it apprehends. I well discern, How in thine intellect already shines The light eternal, which to view alone Ne'er fails to kindle love; and if aught else Your love seduces, 't is but that it shows Some ill-mark'd vestige of that primal beam. 'This would'st thou know, if failure of the vow By other service may be so supplied, As from self-question to assure the soul.' Thus she her words, not heedless of my wish, Began; and thus, as one who breaks not off Discourse, continued in her saintly strain. 'Supreme of gifts, which God creating gave Of his free bounty, sign most evident Of goodness, and in his account most priz'd, Was liberty of will, the boon wherewith All intellectual creatures, and them sole He hath endow'd. Hence now thou mayst infer Of what high worth the vow, which so is fram'd That when man offers, God well-pleas'd accepts; For in the compact between God and him, This treasure, such as I describe it to thee, He makes the victim, and of his own act. What compensation therefore may he find? If that, whereof thou hast oblation made, By using well thou think'st to consecrate, Thou would'st of theft do charitable deed. Thus I resolve thee of the greater point. 'But forasmuch as holy church, herein Dispensing, seems to contradict the truth I have discover'd to thee, yet behooves Thou rest a little longer at the board, Ere the crude aliment, which thou hast taken, Digested fitly to nutrition turn. Open thy mind to what I now unfold, And give it inward keeping. Knowledge comes Of learning well retain'd, unfruitful else. 'This sacrifice in essence of two things Consisteth; one is that, whereof 't is made, The covenant the other. For the last, It ne'er is cancell'd if not kept: and hence I spake erewhile so strictly of its force. For this it was enjoin'd the Israelites, Though leave were giv'n them, as thou know'st, to change The offering, still to offer. Th' other part, The matter and the substance of the vow, May well be such, to that without offence It may for other substance be exchang'd. But at his own discretion none may shift The burden on his shoulders, unreleas'd By either key, the yellow and the white. Nor deem of any change, as less than vain, If the last bond be not within the new Included, as the quatre in the six. No satisfaction therefore can be paid For what so precious in the balance weighs, That all in counterpoise must kick the beam. Take then no vow at random: ta'en, with faith Preserve it; yet not bent, as Jephthah once, Blindly to execute a rash resolve, Whom better it had suited to exclaim, 'I have done ill,' than to redeem his pledge By doing worse or, not unlike to him In folly, that great leader of the Greeks: Whence, on the alter, Iphigenia mourn'd Her virgin beauty, and hath since made mourn Both wise and simple, even all, who hear Of so fell sacrifice. Be ye more staid, O Christians, not, like feather, by each wind Removable: nor think to cleanse ourselves In every water. Either testament, The old and new, is yours: and for your guide The shepherd of the church let this suffice To save you. When by evil lust entic'd, Remember ye be men, not senseless beasts; Nor let the Jew, who dwelleth in your streets, Hold you in mock'ry. Be not, as the lamb, That, fickle wanton, leaves its mother's milk, To dally with itself in idle play.' Such were the words that Beatrice spake: These ended, to that region, where the world Is liveliest, full of fond desire she turn'd. Though mainly prompt new question to propose, Her silence and chang'd look did keep me dumb. And as the arrow, ere the cord is still, Leapeth unto its mark; so on we sped Into the second realm. There I beheld The dame, so joyous enter, that the orb Grew brighter at her smiles; and, if the star Were mov'd to gladness, what then was my cheer, Whom nature hath made apt for every change! As in a quiet and clear lake the fish, If aught approach them from without, do draw Towards it, deeming it their food; so drew Full more than thousand splendours towards us, And in each one was heard: 'Lo! one arriv'd To multiply our loves!' and as each came The shadow, streaming forth effulgence new, Witness'd augmented joy. Here, reader! think, If thou didst miss the sequel of my tale, To know the rest how sorely thou wouldst crave; And thou shalt see what vehement desire Possess'd me, as soon as these had met my view, To know their state. 'O born in happy hour! Thou to whom grace vouchsafes, or ere thy close Of fleshly warfare, to behold the thrones Of that eternal triumph, know to us The light communicated, which through heaven Expatiates without bound. Therefore, if aught Thou of our beams wouldst borrow for thine aid, Spare not; and of our radiance take thy fill.' Thus of those piteous spirits one bespake me; And Beatrice next: 'Say on; and trust As unto gods!'--'How in the light supreme Thou harbour'st, and from thence the virtue bring'st, That, sparkling in thine eyes, denotes thy joy, I mark; but, who thou art, am still to seek; Or wherefore, worthy spirit! for thy lot This sphere assign'd, that oft from mortal ken Is veil'd by others' beams.' I said, and turn'd Toward the lustre, that with greeting, kind Erewhile had hail'd me. Forthwith brighter far Than erst, it wax'd: and, as himself the sun Hides through excess of light, when his warm gaze Hath on the mantle of thick vapours prey'd; Within its proper ray the saintly shape Was, through increase of gladness, thus conceal'd; And, shrouded so in splendour answer'd me, E'en as the tenour of my song declares.\" }, " + "{ \"canto\": \"VI\", \"text\": \"'After that Constantine the eagle turn'd Against the motions of the heav'n, that roll'd Consenting with its course, when he of yore, Lavinia's spouse, was leader of the flight, A hundred years twice told and more, his seat At Europe's extreme point, the bird of Jove Held, near the mountains, whence he issued first. There, under shadow of his sacred plumes Swaying the world, till through successive hands To mine he came devolv'd. Caesar I was, And am Justinian; destin'd by the will Of that prime love, whose influence I feel, From vain excess to clear th' encumber'd laws. Or ere that work engag'd me, I did hold Christ's nature merely human, with such faith Contented. But the blessed Agapete, Who was chief shepherd, he with warning voice To the true faith recall'd me. I believ'd His words: and what he taught, now plainly see, As thou in every contradiction seest The true and false oppos'd. Soon as my feet Were to the church reclaim'd, to my great task, By inspiration of God's grace impell'd, I gave me wholly, and consign'd mine arms To Belisarius, with whom heaven's right hand Was link'd in such conjointment, 't was a sign That I should rest. To thy first question thus I shape mine answer, which were ended here, But that its tendency doth prompt perforce To some addition; that thou well, mayst mark What reason on each side they have to plead, By whom that holiest banner is withstood, Both who pretend its power and who oppose. 'Beginning from that hour, when Pallas died To give it rule, behold the valorous deeds Have made it worthy reverence. Not unknown To thee, how for three hundred years and more It dwelt in Alba, up to those fell lists Where for its sake were met the rival three; Nor aught unknown to thee, which it achiev'd Down to the Sabines' wrong to Lucrece' woe, With its sev'n kings conqu'ring the nation round; Nor all it wrought, by Roman worthies home 'Gainst Brennus and th' Epirot prince, and hosts Of single chiefs, or states in league combin'd Of social warfare; hence Torquatus stern, And Quintius nam'd of his neglected locks, The Decii, and the Fabii hence acquir'd Their fame, which I with duteous zeal embalm. By it the pride of Arab hordes was quell'd, When they led on by Hannibal o'erpass'd The Alpine rocks, whence glide thy currents, Po! Beneath its guidance, in their prime of days Scipio and Pompey triumph'd; and that hill, Under whose summit thou didst see the light, Rued its stern bearing. After, near the hour, When heav'n was minded that o'er all the world His own deep calm should brood, to Caesar's hand Did Rome consign it; and what then it wrought From Var unto the Rhine, saw Isere's flood, Saw Loire and Seine, and every vale, that fills The torrent Rhone. What after that it wrought, When from Ravenna it came forth, and leap'd The Rubicon, was of so bold a flight, That tongue nor pen may follow it. Tow'rds Spain It wheel'd its bands, then tow'rd Dyrrachium smote, And on Pharsalia with so fierce a plunge, E'en the warm Nile was conscious to the pang; Its native shores Antandros, and the streams Of Simois revisited, and there Where Hector lies; then ill for Ptolemy His pennons shook again; lightning thence fell On Juba; and the next upon your west, At sound of the Pompeian trump, return'd. 'What following and in its next bearer's gripe It wrought, is now by Cassius and Brutus Bark'd off in hell, and by Perugia's sons And Modena's was mourn'd. Hence weepeth still Sad Cleopatra, who, pursued by it, Took from the adder black and sudden death. With him it ran e'en to the Red Sea coast; With him compos'd the world to such a peace, That of his temple Janus barr'd the door. 'But all the mighty standard yet had wrought, And was appointed to perform thereafter, Throughout the mortal kingdom which it sway'd, Falls in appearance dwindled and obscur'd, If one with steady eye and perfect thought On the third Caesar look; for to his hands, The living Justice, in whose breath I move, Committed glory, e'en into his hands, To execute the vengeance of its wrath. 'Hear now and wonder at what next I tell. After with Titus it was sent to wreak Vengeance for vengeance of the ancient sin, And, when the Lombard tooth, with fangs impure, Did gore the bosom of the holy church, Under its wings victorious, Charlemagne Sped to her rescue. Judge then for thyself Of those, whom I erewhile accus'd to thee, What they are, and how grievous their offending, Who are the cause of all your ills. The one Against the universal ensign rears The yellow lilies, and with partial aim That to himself the other arrogates: So that 't is hard to see which more offends. Be yours, ye Ghibellines, to veil your arts Beneath another standard: ill is this Follow'd of him, who severs it and justice: And let not with his Guelphs the new-crown'd Charles Assail it, but those talons hold in dread, Which from a lion of more lofty port Have rent the easing. Many a time ere now The sons have for the sire's transgression wail'd; Nor let him trust the fond belief, that heav'n Will truck its armour for his lilied shield. 'This little star is furnish'd with good spirits, Whose mortal lives were busied to that end, That honour and renown might wait on them: And, when desires thus err in their intention, True love must needs ascend with slacker beam. But it is part of our delight, to measure Our wages with the merit; and admire The close proportion. Hence doth heav'nly justice Temper so evenly affection in us, It ne'er can warp to any wrongfulness. Of diverse voices is sweet music made: So in our life the different degrees Render sweet harmony among these wheels. 'Within the pearl, that now encloseth us, Shines Romeo's light, whose goodly deed and fair Met ill acceptance. But the Provencals, That were his foes, have little cause for mirth. Ill shapes that man his course, who makes his wrong Of other's worth. Four daughters were there born To Raymond Berenger, and every one Became a queen; and this for him did Romeo, Though of mean state and from a foreign land. Yet envious tongues incited him to ask A reckoning of that just one, who return'd Twelve fold to him for ten. Aged and poor He parted thence: and if the world did know The heart he had, begging his life by morsels, 'T would deem the praise, it yields him, scantly dealt.'\" }, " + "{ \"canto\": \"VII\", \"text\": \"'Hosanna Sanctus Deus Sabaoth Superillustrans claritate tua Felices ignes horum malahoth!' Thus chanting saw I turn that substance bright With fourfold lustre to its orb again, Revolving; and the rest unto their dance With it mov'd also; and like swiftest sparks, In sudden distance from my sight were veil'd. Me doubt possess'd, and 'Speak,' it whisper'd me, 'Speak, speak unto thy lady, that she quench Thy thirst with drops of sweetness.' Yet blank awe, Which lords it o'er me, even at the sound Of Beatrice's name, did bow me down As one in slumber held. Not long that mood Beatrice suffer'd: she, with such a smile, As might have made one blest amid the flames, Beaming upon me, thus her words began: 'Thou in thy thought art pond'ring (as I deem), And what I deem is truth how just revenge Could be with justice punish'd: from which doubt I soon will free thee; so thou mark my words; For they of weighty matter shall possess thee. 'That man, who was unborn, himself condemn'd, And, in himself, all, who since him have liv'd, His offspring: whence, below, the human kind Lay sick in grievous error many an age; Until it pleas'd the Word of God to come Amongst them down, to his own person joining The nature, from its Maker far estrang'd, By the mere act of his eternal love. Contemplate here the wonder I unfold. The nature with its Maker thus conjoin'd, Created first was blameless, pure and good; But through itself alone was driven forth From Paradise, because it had eschew'd The way of truth and life, to evil turn'd. Ne'er then was penalty so just as that Inflicted by the cross, if thou regard The nature in assumption doom'd: ne'er wrong So great, in reference to him, who took Such nature on him, and endur'd the doom. God therefore and the Jews one sentence pleased: So different effects flow'd from one act, And heav'n was open'd, though the earth did quake. Count it not hard henceforth, when thou dost hear That a just vengeance was by righteous court Justly reveng'd. But yet I see thy mind By thought on thought arising sore perplex'd, And with how vehement desire it asks Solution of the maze. What I have heard, Is plain, thou sayst: but wherefore God this way For our redemption chose, eludes my search. 'Brother! no eye of man not perfected, Nor fully ripen'd in the flame of love, May fathom this decree. It is a mark, In sooth, much aim'd at, and but little kenn'd: And I will therefore show thee why such way Was worthiest. The celestial love, that spume All envying in its bounty, in itself With such effulgence blazeth, as sends forth All beauteous things eternal. What distils Immediate thence, no end of being knows, Bearing its seal immutably impress'd. Whatever thence immediate falls, is free, Free wholly, uncontrollable by power Of each thing new: by such conformity More grateful to its author, whose bright beams, Though all partake their shining, yet in those Are liveliest, which resemble him the most. These tokens of pre-eminence on man Largely bestow'd, if any of them fail, He needs must forfeit his nobility, No longer stainless. Sin alone is that, Which doth disfranchise him, and make unlike To the chief good; for that its light in him Is darken'd. And to dignity thus lost Is no return; unless, where guilt makes void, He for ill pleasure pay with equal pain. Your nature, which entirely in its seed Trangress'd, from these distinctions fell, no less Than from its state in Paradise; nor means Found of recovery (search all methods out As strickly as thou may) save one of these, The only fords were left through which to wade, Either that God had of his courtesy Releas'd him merely, or else man himself For his own folly by himself aton'd. 'Fix now thine eye, intently as thou canst, On th' everlasting counsel, and explore, Instructed by my words, the dread abyss. 'Man in himself had ever lack'd the means Of satisfaction, for he could not stoop Obeying, in humility so low, As high he, disobeying, thought to soar: And for this reason he had vainly tried Out of his own sufficiency to pay The rigid satisfaction. Then behooved That God should by his own ways lead him back Unto the life, from whence he fell, restor'd: By both his ways, I mean, or one alone. But since the deed is ever priz'd the more, The more the doer's good intent appears, Goodness celestial, whose broad signature Is on the universe, of all its ways To raise ye up, was fain to leave out none, Nor aught so vast or so magnificent, Either for him who gave or who receiv'd Between the last night and the primal day, Was or can be. For God more bounty show'd. Giving himself to make man capable Of his return to life, than had the terms Been mere and unconditional release. And for his justice, every method else Were all too scant, had not the Son of God Humbled himself to put on mortal flesh. 'Now, to fulfil each wish of thine, remains I somewhat further to thy view unfold. That thou mayst see as clearly as myself. 'I see, thou sayst, the air, the fire I see, The earth and water, and all things of them Compounded, to corruption turn, and soon Dissolve. Yet these were also things create, Because, if what were told me, had been true They from corruption had been therefore free. 'The angels, O my brother! and this clime Wherein thou art, impassible and pure, I call created, as indeed they are In their whole being. But the elements, Which thou hast nam'd, and what of them is made, Are by created virtue' inform'd: create Their substance, and create the' informing virtue In these bright stars, that round them circling move The soul of every brute and of each plant, The ray and motion of the sacred lights, With complex potency attract and turn. But this our life the' eternal good inspires Immediate, and enamours of itself; So that our wishes rest for ever here. 'And hence thou mayst by inference conclude Our resurrection certain, if thy mind Consider how the human flesh was fram'd, When both our parents at the first were made.'\" }, " + "{ \"canto\": \"VIII\", \"text\": \"The world was in its day of peril dark Wont to believe the dotage of fond love From the fair Cyprian deity, who rolls In her third epicycle, shed on men By stream of potent radiance: therefore they Of elder time, in their old error blind, Not her alone with sacrifice ador'd And invocation, but like honours paid To Cupid and Dione, deem'd of them Her mother, and her son, him whom they feign'd To sit in Dido's bosom: and from her, Whom I have sung preluding, borrow'd they The appellation of that star, which views, Now obvious and now averse, the sun. I was not ware that I was wafted up Into its orb; but the new loveliness That grac'd my lady, gave me ample proof That we had entered there. And as in flame A sparkle is distinct, or voice in voice Discern'd, when one its even tenour keeps, The other comes and goes; so in that light I other luminaries saw, that cours'd In circling motion, rapid more or less, As their eternal phases each impels. Never was blast from vapour charged with cold, Whether invisible to eye or no, Descended with such speed, it had not seem'd To linger in dull tardiness, compar'd To those celestial lights, that tow'rds us came, Leaving the circuit of their joyous ring, Conducted by the lofty seraphim. And after them, who in the van appear'd, Such an hosanna sounded, as hath left Desire, ne'er since extinct in me, to hear Renew'd the strain. Then parting from the rest One near us drew, and sole began: 'We all Are ready at thy pleasure, well dispos'd To do thee gentle service. We are they, To whom thou in the world erewhile didst Sing 'O ye! whose intellectual ministry Moves the third heaven!' and in one orb we roll, One motion, one impulse, with those who rule Princedoms in heaven; yet are of love so full, That to please thee 't will be as sweet to rest.' After mine eyes had with meek reverence Sought the celestial guide, and were by her Assur'd, they turn'd again unto the light Who had so largely promis'd, and with voice That bare the lively pressure of my zeal, 'Tell who ye are,' I cried. Forthwith it grew In size and splendour, through augmented joy; And thus it answer'd: 'A short date below The world possess'd me. Had the time been more, Much evil, that will come, had never chanc'd. My gladness hides thee from me, which doth shine Around, and shroud me, as an animal In its own silk unswath'd. Thou lov'dst me well, And had'st good cause; for had my sojourning Been longer on the earth, the love I bare thee Had put forth more than blossoms. The left bank, That Rhone, when he hath mix'd with Sorga, laves. 'In me its lord expected, and that horn Of fair Ausonia, with its boroughs old, Bari, and Croton, and Gaeta pil'd, From where the Trento disembogues his waves, With Verde mingled, to the salt sea-flood. Already on my temples beam'd the crown, Which gave me sov'reignty over the land By Danube wash'd, whenas he strays beyond The limits of his German shores. The realm, Where, on the gulf by stormy Eurus lash'd, Betwixt Pelorus and Pachynian heights, The beautiful Trinacria lies in gloom (Not through Typhaeus, but the vap'ry cloud Bituminous upsteam'd), THAT too did look To have its scepter wielded by a race Of monarchs, sprung through me from Charles and Rodolph; had not ill lording which doth spirit up The people ever, in Palermo rais'd The shout of 'death,' re-echo'd loud and long. Had but my brother's foresight kenn'd as much, He had been warier that the greedy want Of Catalonia might not work his bale. And truly need there is, that he forecast, Or other for him, lest more freight be laid On his already over-laden bark. Nature in him, from bounty fall'n to thrift, Would ask the guard of braver arms, than such As only care to have their coffers fill'd.' 'My liege, it doth enhance the joy thy words Infuse into me, mighty as it is, To think my gladness manifest to thee, As to myself, who own it, when thou lookst Into the source and limit of all good, There, where thou markest that which thou dost speak, Thence priz'd of me the more. Glad thou hast made me. Now make intelligent, clearing the doubt Thy speech hath raised in me; for much I muse, How bitter can spring up, when sweet is sown.' I thus inquiring; he forthwith replied: 'If I have power to show one truth, soon that Shall face thee, which thy questioning declares Behind thee now conceal'd. The Good, that guides And blessed makes this realm, which thou dost mount, Ordains its providence to be the virtue In these great bodies: nor th' all perfect Mind Upholds their nature merely, but in them Their energy to save: for nought, that lies Within the range of that unerring bow, But is as level with the destin'd aim, As ever mark to arrow's point oppos'd. Were it not thus, these heavens, thou dost visit, Would their effect so work, it would not be Art, but destruction; and this may not chance, If th' intellectual powers, that move these stars, Fail not, or who, first faulty made them fail. Wilt thou this truth more clearly evidenc'd?' To whom I thus: 'It is enough: no fear, I see, lest nature in her part should tire.' He straight rejoin'd: 'Say, were it worse for man, If he liv'd not in fellowship on earth?' 'Yea,' answer'd I; 'nor here a reason needs.' 'And may that be, if different estates Grow not of different duties in your life? Consult your teacher, and he tells you 'no.'' Thus did he come, deducing to this point, And then concluded: 'For this cause behooves, The roots, from whence your operations come, Must differ. Therefore one is Solon born; Another, Xerxes; and Melchisidec A third; and he a fourth, whose airy voyage Cost him his son. In her circuitous course, Nature, that is the seal to mortal wax, Doth well her art, but no distinctions owns 'Twixt one or other household. Hence befalls That Esau is so wide of Jacob: hence Quirinus of so base a father springs, He dates from Mars his lineage. Were it not That providence celestial overrul'd, Nature, in generation, must the path Trac'd by the generator, still pursue Unswervingly. Thus place I in thy sight That, which was late behind thee. But, in sign Of more affection for thee, 't is my will Thou wear this corollary. Nature ever Finding discordant fortune, like all seed Out of its proper climate, thrives but ill. And were the world below content to mark And work on the foundation nature lays, It would not lack supply of excellence. But ye perversely to religion strain Him, who was born to gird on him the sword, And of the fluent phrasemen make your king; Therefore your steps have wander'd from the paths.'\" }, " + "{ \"canto\": \"IX\", \"text\": \"After solution of my doubt, thy Charles, O fair Clemenza, of the treachery spake That must befall his seed: but, 'Tell it not,' Said he, 'and let the destin'd years come round.' Nor may I tell thee more, save that the meed Of sorrow well-deserv'd shall quit your wrongs. And now the visage of that saintly light Was to the sun, that fills it, turn'd again, As to the good, whose plenitude of bliss Sufficeth all. O ye misguided souls! Infatuate, who from such a good estrange Your hearts, and bend your gaze on vanity, Alas for you!--And lo! toward me, next, Another of those splendent forms approach'd, That, by its outward bright'ning, testified The will it had to pleasure me. The eyes Of Beatrice, resting, as before, Firmly upon me, manifested forth Approval of my wish. 'And O,' I cried, 'Blest spirit! quickly be my will perform'd; And prove thou to me, that my inmost thoughts I can reflect on thee.' Thereat the light, That yet was new to me, from the recess, Where it before was singing, thus began, As one who joys in kindness: 'In that part Of the deprav'd Italian land, which lies Between Rialto, and the fountain-springs Of Brenta and of Piava, there doth rise, But to no lofty eminence, a hill, From whence erewhile a firebrand did descend, That sorely sheet the region. From one root I and it sprang; my name on earth Cunizza: And here I glitter, for that by its light This star o'ercame me. Yet I naught repine, Nor grudge myself the cause of this my lot, Which haply vulgar hearts can scarce conceive. 'This jewel, that is next me in our heaven, Lustrous and costly, great renown hath left, And not to perish, ere these hundred years Five times absolve their round. Consider thou, If to excel be worthy man's endeavour, When such life may attend the first. Yet they Care not for this, the crowd that now are girt By Adice and Tagliamento, still Impenitent, tho' scourg'd. The hour is near, When for their stubbornness at Padua's marsh The water shall be chang'd, that laves Vicena And where Cagnano meets with Sile, one Lords it, and bears his head aloft, for whom The web is now a-warping. Feltro too Shall sorrow for its godless shepherd's fault, Of so deep stain, that never, for the like, Was Malta's bar unclos'd. Too large should be The skillet, that would hold Ferrara's blood, And wearied he, who ounce by ounce would weight it, The which this priest, in show of party-zeal, Courteous will give; nor will the gift ill suit The country's custom. We descry above, Mirrors, ye call them thrones, from which to us Reflected shine the judgments of our God: Whence these our sayings we avouch for good.' She ended, and appear'd on other thoughts Intent, re-ent'ring on the wheel she late Had left. That other joyance meanwhile wax'd A thing to marvel at, in splendour glowing, Like choicest ruby stricken by the sun, For, in that upper clime, effulgence comes Of gladness, as here laughter: and below, As the mind saddens, murkier grows the shade. 'God seeth all: and in him is thy sight,' Said I, 'blest Spirit! Therefore will of his Cannot to thee be dark. Why then delays Thy voice to satisfy my wish untold, That voice which joins the inexpressive song, Pastime of heav'n, the which those ardours sing, That cowl them with six shadowing wings outspread? I would not wait thy asking, wert thou known To me, as thoroughly I to thee am known.' He forthwith answ'ring, thus his words began: 'The valley' of waters, widest next to that Which doth the earth engarland, shapes its course, Between discordant shores, against the sun Inward so far, it makes meridian there, Where was before th' horizon. Of that vale Dwelt I upon the shore, 'twixt Ebro's stream And Macra's, that divides with passage brief Genoan bounds from Tuscan. East and west Are nearly one to Begga and my land, Whose haven erst was with its own blood warm. Who knew my name were wont to call me Folco: And I did bear impression of this heav'n, That now bears mine: for not with fiercer flame Glow'd Belus' daughter, injuring alike Sichaeus and Creusa, than did I, Long as it suited the unripen'd down That fledg'd my cheek: nor she of Rhodope, That was beguiled of Demophoon; Nor Jove's son, when the charms of Iole Were shrin'd within his heart. And yet there hides No sorrowful repentance here, but mirth, Not for the fault (that doth not come to mind), But for the virtue, whose o'erruling sway And providence have wrought thus quaintly. Here The skill is look'd into, that fashioneth With such effectual working, and the good Discern'd, accruing to this upper world From that below. But fully to content Thy wishes, all that in this sphere have birth, Demands my further parle. Inquire thou wouldst, Who of this light is denizen, that here Beside me sparkles, as the sun-beam doth On the clear wave. Know then, the soul of Rahab Is in that gladsome harbour, to our tribe United, and the foremost rank assign'd. He to that heav'n, at which the shadow ends Of your sublunar world, was taken up, First, in Christ's triumph, of all souls redeem'd: For well behoov'd, that, in some part of heav'n, She should remain a trophy, to declare The mighty contest won with either palm; For that she favour'd first the high exploit Of Joshua on the holy land, whereof The Pope recks little now. Thy city, plant Of him, that on his Maker turn'd the back, And of whose envying so much woe hath sprung, Engenders and expands the cursed flower, That hath made wander both the sheep and lambs, Turning the shepherd to a wolf. For this, The gospel and great teachers laid aside, The decretals, as their stuft margins show, Are the sole study. Pope and Cardinals, Intent on these, ne'er journey but in thought To Nazareth, where Gabriel op'd his wings. Yet it may chance, erelong, the Vatican, And other most selected parts of Rome, That were the grave of Peter's soldiery, Shall be deliver'd from the adult'rous bond.'\" }, " + "{ \"canto\": \"X\", \"text\": \"Looking into his first-born with the love, Which breathes from both eternal, the first Might Ineffable, whence eye or mind Can roam, hath in such order all dispos'd, As none may see and fail to enjoy. Raise, then, O reader! to the lofty wheels, with me, Thy ken directed to the point, whereat One motion strikes on th' other. There begin Thy wonder of the mighty Architect, Who loves his work so inwardly, his eye Doth ever watch it. See, how thence oblique Brancheth the circle, where the planets roll To pour their wished influence on the world; Whose path not bending thus, in heav'n above Much virtue would be lost, and here on earth, All power well nigh extinct: or, from direct Were its departure distant more or less, I' th' universal order, great defect Must, both in heav'n and here beneath, ensue. Now rest thee, reader! on thy bench, and muse Anticipative of the feast to come; So shall delight make thee not feel thy toil. Lo! I have set before thee, for thyself Feed now: the matter I indite, henceforth Demands entire my thought. Join'd with the part, Which late we told of, the great minister Of nature, that upon the world imprints The virtue of the heaven, and doles out Time for us with his beam, went circling on Along the spires, where each hour sooner comes; And I was with him, weetless of ascent, As one, who till arriv'd, weets not his coming. For Beatrice, she who passeth on So suddenly from good to better, time Counts not the act, oh then how great must needs Have been her brightness! What she was i' th' sun (Where I had enter'd), not through change of hue, But light transparent--did I summon up Genius, art, practice--I might not so speak, It should be e'er imagin'd: yet believ'd It may be, and the sight be justly crav'd. And if our fantasy fail of such height, What marvel, since no eye above the sun Hath ever travel'd? Such are they dwell here, Fourth family of the Omnipotent Sire, Who of his spirit and of his offspring shows; And holds them still enraptur'd with the view. And thus to me Beatrice: 'Thank, oh thank, The Sun of angels, him, who by his grace To this perceptible hath lifted thee.' Never was heart in such devotion bound, And with complacency so absolute Dispos'd to render up itself to God, As mine was at those words: and so entire The love for Him, that held me, it eclips'd Beatrice in oblivion. Naught displeas'd Was she, but smil'd thereat so joyously, That of her laughing eyes the radiance brake And scatter'd my collected mind abroad. Then saw I a bright band, in liveliness Surpassing, who themselves did make the crown, And us their centre: yet more sweet in voice, Than in their visage beaming. Cinctur'd thus, Sometime Latona's daughter we behold, When the impregnate air retains the thread, That weaves her zone. In the celestial court, Whence I return, are many jewels found, So dear and beautiful, they cannot brook Transporting from that realm: and of these lights Such was the song. Who doth not prune his wing To soar up thither, let him look from thence For tidings from the dumb. When, singing thus, Those burning suns that circled round us thrice, As nearest stars around the fixed pole, Then seem'd they like to ladies, from the dance Not ceasing, but suspense, in silent pause, List'ning, till they have caught the strain anew: Suspended so they stood: and, from within, Thus heard I one, who spake: 'Since with its beam The grace, whence true love lighteth first his flame, That after doth increase by loving, shines So multiplied in thee, it leads thee up Along this ladder, down whose hallow'd steps None e'er descend, and mount them not again, Who from his phial should refuse thee wine To slake thy thirst, no less constrained were, Than water flowing not unto the sea. Thou fain wouldst hear, what plants are these, that bloom In the bright garland, which, admiring, girds This fair dame round, who strengthens thee for heav'n. I then was of the lambs, that Dominic Leads, for his saintly flock, along the way, Where well they thrive, not sworn with vanity. He, nearest on my right hand, brother was, And master to me: Albert of Cologne Is this: and of Aquinum, Thomas I. If thou of all the rest wouldst be assur'd, Let thine eye, waiting on the words I speak, In circuit journey round the blessed wreath. That next resplendence issues from the smile Of Gratian, who to either forum lent Such help, as favour wins in Paradise. The other, nearest, who adorns our quire, Was Peter, he that with the widow gave To holy church his treasure. The fifth light, Goodliest of all, is by such love inspired, That all your world craves tidings of its doom: Within, there is the lofty light, endow'd With sapience so profound, if truth be truth, That with a ken of such wide amplitude No second hath arisen. Next behold That taper's radiance, to whose view was shown, Clearliest, the nature and the ministry Angelical, while yet in flesh it dwelt. In the other little light serenely smiles That pleader for the Christian temples, he Who did provide Augustin of his lore. Now, if thy mind's eye pass from light to light, Upon my praises following, of the eighth Thy thirst is next. The saintly soul, that shows The world's deceitfulness, to all who hear him, Is, with the sight of all the good, that is, Blest there. The limbs, whence it was driven, lie Down in Cieldauro, and from martyrdom And exile came it here. Lo! further on, Where flames the arduous Spirit of Isidore, Of Bede, and Richard, more than man, erewhile, In deep discernment. Lastly this, from whom Thy look on me reverteth, was the beam Of one, whose spirit, on high musings bent, Rebuk'd the ling'ring tardiness of death. It is the eternal light of Sigebert, Who 'scap'd not envy, when of truth he argued, Reading in the straw-litter'd street.' Forthwith, As clock, that calleth up the spouse of God To win her bridegroom's love at matin's hour, Each part of other fitly drawn and urg'd, Sends out a tinkling sound, of note so sweet, Affection springs in well-disposed breast; Thus saw I move the glorious wheel, thus heard Voice answ'ring voice, so musical and soft, It can be known but where day endless shines.\" }]}"; Cells cells = CellsUtils.getCellFromJson((org.json.simple.JSONObject) JSONValue.parse(json), "test"); //Metadata: Cells metadataCell = (Cells) cells.getCellByName("metadata").getCellValue(); Assert.assertEquals("DANTE ALIGHIERI", metadataCell.getCellByName("author").getString()); Assert.assertEquals("THE DIVINE COMEDY", metadataCell.getCellByName("title").getString()); Assert.assertEquals("http://www.gutenberg.org/ebooks/8800", metadataCell.getCellByName("source").getString()); //Cantos: List<Cells> cantosCell = (List) cells.getCellByName("cantos").getCellValue(); Assert.assertEquals("I", (cantosCell.get(0)).getCellByName("canto").getString()); Assert.assertEquals("II", (cantosCell.get(1)).getCellByName("canto").getString()); Assert.assertEquals("III", (cantosCell.get(2)).getCellByName("canto").getString()); Assert.assertEquals("IV", (cantosCell.get(3)).getCellByName("canto").getString()); } @Test public void testGetRowFromCells() { Cells cells = new Cells("namespace", Cell.create("cell1", 1), Cell.create("cell2", "test"), Cell.create("cell3", new ArrayList<String>())); Row row = CellsUtils.getRowFromCells(cells); assertEquals(row.length(), cells.size()); assertEquals(row.get(0), 1); assertEquals(row.get(1), "test"); assertEquals(row.get(2), new ArrayList<String>()); } @Test public void testGetRowsFromsCells() { Collection<Cells> cellsCol = new ArrayList<>(); Cells cells = new Cells("namespace", Cell.create("cell1", 1), Cell.create("cell2", "test")); Cells cells2 = new Cells("namespace", Cell.create("cell1", 2), Cell.create("cell2", "test2"), Cell.create("cell3", new ArrayList<String>())); cellsCol.add(cells); cellsCol.add(cells2); Collection<Row> rows = CellsUtils.getRowsFromsCells(cellsCol); assertEquals(rows.size(), cellsCol.size()); } @Test public void testGetSimpleTypesStructTypeFromCells() { Cells cells = new Cells("namespace", Cell.create("string", "test"), Cell.create("bytearray", new Byte[] {}), Cell.create("boolean", true), Cell.create("timestamp", new Timestamp(System.currentTimeMillis())), Cell.create("bigdecimal", new BigDecimal(1)), Cell.create("double", 3.0d), Cell.create("float", 4f), Cell.create("byte", (byte)0xea), Cell.create("integer", 1), Cell.create("long", 3L), Cell.create("short", (short)1)); StructType struct = CellsUtils.getStructTypeFromCells(cells); StructField[] fields = struct.fields(); assertEquals(fields.length, cells.size()); assertEquals(fields[0].dataType(), DataTypes.StringType); assertEquals(fields[0].name(), "string"); assertEquals(fields[1].dataType(), DataTypes.BinaryType); assertEquals(fields[1].name(), "bytearray"); assertEquals(fields[2].dataType(), DataTypes.BooleanType); assertEquals(fields[2].name(), "boolean"); assertEquals(fields[3].dataType(), DataTypes.TimestampType); assertEquals(fields[3].name(), "timestamp"); assertEquals(fields[4].name(), "bigdecimal"); assertEquals(fields[5].name(), "double"); assertEquals(fields[5].dataType(), DataTypes.DoubleType); assertEquals(fields[6].name(), "float"); assertEquals(fields[6].dataType(), DataTypes.FloatType); assertEquals(fields[7].name(), "byte"); assertEquals(fields[7].dataType(), DataTypes.ByteType); assertEquals(fields[8].name(), "integer"); assertEquals(fields[8].dataType(), DataTypes.IntegerType); assertEquals(fields[9].name(), "long"); assertEquals(fields[9].dataType(), DataTypes.LongType); assertEquals(fields[10].name(), "short"); assertEquals(fields[10].dataType(), DataTypes.ShortType); } @Test public void testGetComplexTypesStructTypeFromCells() { List<String> testList = new ArrayList<>(); testList.add("testString"); Map<Integer, String> testMap = new HashMap<>(); testMap.put(1, "testMapEntry"); Cells cells = new Cells("namespace", Cell.create("list", testList), Cell.create("map", testMap)); StructType struct = CellsUtils.getStructTypeFromCells(cells); StructField[] fields = struct.fields(); assertEquals(fields.length, cells.size()); assertEquals(fields[0].name(), "list"); assertTrue(fields[0].dataType() instanceof ArrayType); assertEquals(fields[1].name(), "map"); assertTrue(fields[1].dataType() instanceof MapType); } @Test public void testGetStructTypeEmptyList() { List<Object> testList = new ArrayList<>(); Cells cells = new Cells("namespace", Cell.create("list", testList)); StructType struct = CellsUtils.getStructTypeFromCells(cells); StructField[] fields = struct.fields(); assertEquals(fields.length, cells.size()); assertEquals(fields[0].name(), "list"); assertTrue(fields[0].dataType() instanceof ArrayType); } @Test public void testGetStructTypeEmptyMap() { Map<Integer, Integer> testMap = new HashMap<>(); Cells cells = new Cells("namespace", Cell.create("map", testMap)); StructType struct = CellsUtils.getStructTypeFromCells(cells); StructField[] fields = struct.fields(); assertEquals(fields.length, cells.size()); assertEquals(fields[0].name(), "map"); assertTrue(fields[0].dataType() instanceof MapType); } }