The blockbuster movie The Golden Compass is attracting a whole new audience to Oxford author Philip Pullman's book on which it is based. The opening scenes are set in Oxford - or rather, a version of Oxford, in which familiar settings and real events mingle with thoughtful invention and engaging fantasy.

Prominent among Pullman's adaptations is a distinctive element of Oxford - the working, residential boating population. These gyptians', as Pullman has dubbed them (acknowledging the water gypsy' tag often applied to the boating fraternity), play a key role in the novel Northern Lights, which inspired the film. They feature too in the extract from a supposed Oxford Guide which is included in Pullman's more recent book, Lyra's Oxford.

Within the adventure, the fantasy, and pseudo-history of these two books are elements of historical fact and pleasingly accurate insights into life afloat.

Jericho is depicted as the hub of the gyptian activities in Oxford - exactly as it was for those working on the canal after the Second World War. At this time, the Jericho wharves proved entirely adequate to replace the city-centre terminus, which had been sold.

So it is possible to imagine a Jericho where the wharves really were "bright with gleaming harness and loud with the clop of hooves and clamour of bargaining" as Pullman writes.

At least, it just about remains possible, while the old Jericho boatyard site retains some hope of rebuffing the ugly, insensitively-designed new buildings proposed in the current planning application.

Jericho and its canal are central too to Lyra's Oxford. When Lyra is ambushed, while searching for an alchemist living in Juxon Street, she is saved by the heroic intervention of a swan from the canal.

The supposed pages of an Oxford Guide within the book are also the vehicle for a mingling of factual and fantastical Jericho, especially in respect of the former Lucy's iron foundry.

The connection is made through an imagined former Jericho resident, Randolph Lucy, a famous alchemist whose daemon was an eagle: the factual foundry was known as the Eagle Ironworks prior to the Lucy family's involvement. The guide's assertion that it was "founded by the celebrated ironmaster Walter Thrupp in 1812" is also laced with the truth, that being the year that William Carter, the founder of the firm, opened his first ironmonger's shop in Oxford's High Street.

Pullman teases us with some history of early Oxford too. According to Lyra's Oxford, 1005 was the date of a battle at Wolvercote in which "a band of stout-hearted Oxford citizens" combined forces with some "valiant Gyptian allies" to inflict a decisive defeat on a raiding party of Vikings, who never again threatened the city. The reality is that as a key stronghold in the defence of Wessex, Oxford did indeed rebuff attacks by Viking invaders, to the gratitude of successive kings.

But the Thames has been more important for the trading opportunities it offered. Pullman's suggestion that the victory over the Vikings marked the beginning of a thousand years of "unbroken commerce and somewhat wary friendship' undoubtedly reflects a truism. For centuries, boatmen have been mistrusted by sedentary Oxford, which "nevertheless depended on the canal-boats for the goods and raw materials they brought to the city's shops, markets and factories".

This assuredly reflects how things were in the early years of the real Oxford Canal in the 1790s.

Steeped in centuries of academic tradition, Oxford was slow to accept the infiltration of an industrial waterway.

An early (genuine) guidebook portrayed the city's mixed feelings. While acknowledging how very useful these new "liquid roads" were, the writer hoped that the Thames would "never be defiled, or its scaly inhabitants suffocated by filth, its murmurs never lost in the din of machinery, or the native music of its groves ever exchanged for oaths and curses."

These historical tensions between the boatmen and residents of Oxford are realised early on in Northern Lights, through the book's university-based heroine, Lyra, and one of the gyptian families who "came and went with the spring and autumn fairs, and were always good for a fight".

The Costas, "who regularly returned to their mooring in that part of the city known as Jericho", was a family with whom Lyra had been feuding "ever since she could first throw a stone". It is a situation which has shades of Oxford's age-old Town and Gown rivalries, epitomised in regular affrays between mobs of scholars and townsmen. Inevitably, bargemen would be prominent amongst the forces of the Town.

It is on a quest to provoke the Costa family that Lyra first learns of the disappearance of their boy, Billy. They are in Oxford for the annual horse fair on Port Meadow. This great event in the gyptian calendar is another example of Pullmanesque part-reality.

Horse races were held each summer from 1680 to 1880 on Port Meadow. These races were great social gatherings, as were the horse fairs of Lyra's world, attracting people from all over the county, and with a similar purpose of celebrating the best in equine breeding.

There is realism too in Pullman's allusion to the boatmen's supposed light-fingeredness and licentiousness - to which Victorian observers freely added excessive drunkenness, blasphemy, and violence. Lyra's guide therefore notes that during the July Horse Fair many "small objects vanish from unguarded windowsills", and adds the "remarkable fact that more children are born in Oxford in April than in any other month".

But Northern Lights reveals the caring side of the extended community too, in the context of the book's sinister theme of child-snatching: "In the tight-knit gyptian boat-world, all children were precious and extravagantly loved, and a mother knew that if a child was out of her sight, it wouldn't be far from someone else's." And the gyptians do, of course, help to save the day!

So, thank you, Mr Pullman, if I may. Historically, very few people have written much in praise of boat people, but as a resident of an Oxford narrowboat myself, a modern-day gyptian, if you like, perhaps on behalf of Oxford boating families, past and present, I can say how great it feels to be depicted as heroes! In fact, it's more than great, it's fantastic.

Mark Davies is co-author of A Towpath Walk in Oxford: the Canal and River Thames between Wolvercote and the City. He leads regular group walks along Oxford's towpaths, on historical and literary themes, including for the Oxford Literary Festival. See www.oxfordwaterwalks.co.uk or contact towpathpress@btopenworld.com.