Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package io.konig.core.pojo;
/*
* #%L
* Konig Core
* %%
* Copyright (C) 2015 - 2016 Gregory McFall
* %%
* 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.
* #L%
*/
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.openrdf.model.Namespace;
import org.openrdf.model.Resource;
import org.openrdf.model.URI;
import org.openrdf.model.Value;
import org.openrdf.model.ValueFactory;
import org.openrdf.model.impl.ValueFactoryImpl;
import org.openrdf.model.vocabulary.RDF;
import io.konig.annotation.RdfList;
import io.konig.annotation.RdfProperty;
import io.konig.core.Graph;
import io.konig.core.KonigException;
import io.konig.core.NamespaceManager;
import io.konig.core.Vertex;
import io.konig.shacl.PropertyConstraint;
import io.konig.shacl.Shape;
public class SimplePojoEmitter implements PojoEmitter {
private static SimplePojoEmitter INSTANCE = new SimplePojoEmitter();
private ValueFactory valueFactory = ValueFactoryImpl.getInstance();
public static SimplePojoEmitter getInstance() {
return INSTANCE;
}
@Override
public void emit(EmitContext context, Object pojo, Graph sink) {
Worker worker = new Worker(context, sink);
worker.emit(pojo);
}
public void emit(Object pojo, Graph sink) {
emit(new EmitContext(sink), pojo, sink);
}
@Override
public void emit(NamespaceManager nsManager, Shape shape, Object pojo, Graph sink) {
Worker worker = new Worker(nsManager, sink);
worker.emit(shape, pojo);
}
private class Worker {
private EmitContext context;
private Map