My answer uses the tcolorbox
package for assistence with the boxing problem. Note that you should use the current version 3.12 (2014/07/29)
of the package, i.e. you may have to update first.
Version 1:
The basic idea of the solution is to box the listing with a tcolorbox
which is enlarged into the margins of the page. Here, I used a brutal enlargement of 5cm to both sides without fine-tuning to the real margins. But, if your actual margins are not larger than 5cm, this should work also for two-sided documents.
\documentclass{article}
\usepackage{color}
\usepackage[listings,skins,breakable,xparse]{tcolorbox}
\definecolor{MyLightGray}{RGB}{200, 200,200}
\lstdefinelanguage{turtle}
{
columns=fullflexible,
keywordstyle=\color{red},
morekeywords={@prefix,@base,@forSome,@forAll,@keywords},
morecomment=[l]{\#},
tabsize=4,
alsoletter={-?}, % allowed in names
morecomment=[s][\color{blue}]{<}{>},
basicstyle=\ttfamily\color{black},
%numberstyle=\color{black},
morestring=[b][\color{black}]\",
backgroundcolor=\color{MyLightGray},
}
\NewTCBListing{widelisting}{ O{} O{} }{
listing only,breakable,listing options={#1,aboveskip=0pt,belowskip=0pt},
enhanced,sharp corners,size=tight,boxrule=0pt,frame hidden,
width=\textwidth+10cm,
enlarge left by=-5cm,left=5cm,
enlarge right by=-5cm,right=5cm,
colback=MyLightGray,
#2 }
\begin{document}
\begin{lstlisting}[language=turtle, captionpos=t]
@prefix something: <http://example.org/something/>
something:subject something:predicate something:object .
\end{lstlisting}
\begin{widelisting}[language=turtle]
@prefix something: <http://example.org/something/>
something:subject something:predicate something:object .
\end{widelisting}
\end{document}
You will see that the new environment widelisting
also has no tiny white lines when viewed with a previewer.

Version 2:
If you want to have a caption or title for your listing, you have to add some modifications. To mimic the original lstlisting
, the following could be used which blends with normal lisitings:
\documentclass{article}
\usepackage{color}
\usepackage[listings,skins,breakable,xparse]{tcolorbox}
\definecolor{MyLightGray}{RGB}{200, 200,200}
\lstdefinelanguage{turtle}
{
columns=fullflexible,
keywordstyle=\color{red},
morekeywords={@prefix,@base,@forSome,@forAll,@keywords},
morecomment=[l]{\#},
tabsize=4,
alsoletter={-?}, % allowed in names
morecomment=[s][\color{blue}]{<}{>},
basicstyle=\ttfamily\color{black},
%numberstyle=\color{black},
morestring=[b][\color{black}]\",
backgroundcolor=\color{MyLightGray},
}
\NewTCBListing[use counter=lstlisting,list inside=lol,list type=lstlisting]{widelistingtitled}{ O{} O{} m }{
listing only,breakable,listing options={#1,aboveskip=0pt,belowskip=0pt},
enhanced,sharp corners,size=tight,boxrule=0pt,frame hidden,
width=\textwidth+10cm,
enlarge left by=-5cm,left=5cm,
enlarge right by=-5cm,right=5cm,
colback=MyLightGray,
title=Listing~\thetcbcounter:~#3,
list entry={\protect\numberline{\thetcbcounter}#3},
attach boxed title to top center,coltitle=black,
boxed title style={width=textwidth,empty},
#2 }
\begin{document}
\lstlistoflistings
\begin{lstlisting}[language=turtle, captionpos=t, caption=Original Example]
@prefix something: <http://example.org/something/>
something:subject something:predicate something:object .
\end{lstlisting}
\begin{widelistingtitled}[language=turtle]{Wide Listing with Title}
@prefix something: <http://example.org/something/>
something:subject something:predicate something:object .
\end{widelistingtitled}
\end{document}
The output is:

Version 3:
As a variant, I use some color and additional lines here:
\documentclass{article}
\usepackage{color}
\usepackage[listings,skins,breakable,xparse]{tcolorbox}
\definecolor{MyLightGray}{RGB}{200, 200,200}
\lstdefinelanguage{turtle}
{
columns=fullflexible,
keywordstyle=\color{red},
morekeywords={@prefix,@base,@forSome,@forAll,@keywords},
morecomment=[l]{\#},
tabsize=4,
alsoletter={-?}, % allowed in names
morecomment=[s][\color{blue}]{<}{>},
basicstyle=\ttfamily\color{black},
%numberstyle=\color{black},
morestring=[b][\color{black}]\",
backgroundcolor=\color{MyLightGray},
}
\NewTCBListing[use counter=lstlisting,list inside=lol,list type=lstlisting]{widelistingtitled}{ O{} O{} m }{
listing only,breakable,listing options={#1,aboveskip=0pt,belowskip=0pt},
enhanced,sharp corners,size=tight,top=1mm,bottom=1mm,boxrule=0.5mm,
colframe=MyLightGray!50!blue,
width=\textwidth+10cm,
enlarge left by=-5cm,left=5cm,
enlarge right by=-5cm,right=5cm,
colback=MyLightGray,
title=Listing~\thetcbcounter:~#3,
list entry={\protect\numberline{\thetcbcounter}#3},
attach boxed title to top center={yshift=-0.4mm},coltitle=black,
boxed title style={width=textwidth,colback=blue!15!white,sharp corners=south},
#2 }
\begin{document}
\lstlistoflistings
\begin{lstlisting}[language=turtle, captionpos=t, caption=Original Example]
@prefix something: <http://example.org/something/>
something:subject something:predicate something:object .
\end{lstlisting}
\begin{widelistingtitled}[language=turtle]{Wide Listing with Title}
@prefix something: <http://example.org/something/>
something:subject something:predicate something:object .
\end{widelistingtitled}
\end{document}
This gives:

linewidth
key. Setlinewidth=\textwidth
in the option ofturtle
.