private boolean isItemInMarkupItem(Resource item, Set<Resource> visitedItems) {
		if (!visitedItems.contains(item)) {
			visitedItems.add(item);
			
			Set<Resource> subjects = model.listResourcesWithProperty(pitem_r, item).toSet();
			subjects.addAll(model.listResourcesWithProperty(pfirstitem_r, item).toSet());
			subjects.addAll(model.listResourcesWithProperty(plastitem_r, item).toSet());
			Iterator<Resource> subjectsIte = subjects.iterator();
			while (subjectsIte.hasNext()) {
				Resource resource = subjectsIte.next();
				if (
						visited.contains(resource) && 
						document.getEntityById(resource.getURI()) instanceof MarkupItem) {
					return true;
				}
			}
			
			Set<Resource> objects = model.listResourcesWithProperty(pnextitem_r, item).toSet();
			NodeIterator nodes = model.listObjectsOfProperty(item, ppreviousitem_r);
			while (nodes.hasNext()) {
				RDFNode node = nodes.next();
				if (node.isResource()) {
					objects.add((Resource) node);
				}
			}
			Iterator<Resource> objectsIte = objects.iterator();
			while (objectsIte.hasNext()) {
				if (isItemInMarkupItem(objectsIte.next(), visitedItems)) {
					return true;
				}
			}
		}
		
		return false;
	}