/** * @param storageGraph * the storageGraph to set */ public void setStorageGraph(Graph storageGraph) { this.storageGraph = storageGraph; if (storageGraph != null) { vf = storageGraph.getValueFactory(); } }
public SerializerContext( Graph graph ) { this.valueFactory = graph.getValueFactory(); this.graph = graph; }
public SerializerContext( Graph graph ) { this.valueFactory = graph.getValueFactory(); this.graph = graph; }
/** * Describe the service end point(s). * * @see #endpoint */ protected void describeServiceEndpoints() { for (String uri : serviceURI) { g.add(aService, SD.endpoint, g.getValueFactory().createURI(uri)); } }
/** * Describe the service end point(s). * * @see #endpoint */ protected void describeServiceEndpoints() { for (String uri : serviceURI) { g.add(aService, SD.endpoint, g.getValueFactory().createURI(uri)); } }
@Override public Resource export(Graph graph) { Resource implNode = super.export(graph); if (propertiesFile != null) { graph.add(implNode, BigdataConfigSchema.PROPERTIES, graph.getValueFactory().createLiteral(propertiesFile)); } return implNode; }
@Override public Resource export(Graph graph) { Resource implNode = super.export(graph); if (propertiesFile != null) { graph.add(implNode, BigdataConfigSchema.PROPERTIES, graph.getValueFactory().createLiteral(propertiesFile)); } return implNode; }
@Override public Resource export(Graph graph) { Resource implNode = super.export(graph); if (propertiesFile != null) { graph.add(implNode, BigdataConfigSchema.PROPERTIES, graph.getValueFactory().createLiteral(propertiesFile)); } return implNode; }
@Override public Resource export(Graph graph) { Resource implNode = super.export(graph); if (propertiesFile != null) { graph.add(implNode, BigdataConfigSchema.PROPERTIES, graph.getValueFactory().createLiteral(propertiesFile)); } return implNode; }
private void serializeMixinTypes( final EntityDescriptor entityDescriptor, final Graph graph, final URI entityTypeUri ) { ValueFactory values = graph.getValueFactory(); entityDescriptor.mixinTypes().forEach( mixinType -> { graph.add( entityTypeUri, Rdfs.SUB_CLASS_OF, values.createURI( Classes.toURI( mixinType ) ) ); } ); }
private void serializeMixinTypes( final EntityDescriptor entityDescriptor, final Graph graph, final URI entityTypeUri ) { ValueFactory values = graph.getValueFactory(); // Mixin types for( Class<?> mixinType : entityDescriptor.mixinTypes() ) { graph.add( entityTypeUri, Rdfs.SUB_CLASS_OF, values.createURI( Classes.toURI( mixinType ) ) ); } }
@Override public Resource export(Graph graph) { Resource implNode = super.export(graph); ValueFactory vf = graph.getValueFactory(); if (url != null) { graph.add(implNode, ENDPOINT, vf.createURI(url)); } for (String space : subjects) { graph.add(implNode, SUBJECT_SPACE, vf.createURI(space)); } return implNode; }
@Override public Resource export(Graph graph) { Resource subj = super.export(graph); ValueFactory vf = graph.getValueFactory(); graph.add(subj, SNAPSHOT, vf.createLiteral(snapshot)); graph.add(subj, SERIALIZABLE, vf.createLiteral(serializable)); return subj; }
private void serializeAssociationTypes( final EntityDescriptor entityDescriptor, final Graph graph, final URI entityTypeUri ) { ValueFactory values = graph.getValueFactory(); // Associations entityDescriptor.state().associations().forEach( associationType -> { URI associationURI = values.createURI( associationType.qualifiedName().toURI() ); graph.add( associationURI, Rdfs.DOMAIN, entityTypeUri ); graph.add( associationURI, Rdfs.TYPE, Rdfs.PROPERTY ); URI associatedURI = values.createURI( Classes.toURI( Classes.RAW_CLASS.apply( associationType.type() ) ) ); graph.add( associationURI, Rdfs.RANGE, associatedURI ); graph.add( associationURI, Rdfs.RANGE, XMLSchema.ANYURI ); } ); }
private void serializeManyAssociationTypes( final EntityDescriptor entityDescriptor, final Graph graph, final URI entityTypeUri ) { ValueFactory values = graph.getValueFactory(); // ManyAssociations entityDescriptor.state().manyAssociations().forEach( manyAssociationType -> { URI associationURI = values.createURI( manyAssociationType.qualifiedName().toURI() ); graph.add( associationURI, Rdfs.DOMAIN, entityTypeUri ); graph.add( associationURI, Rdfs.TYPE, Rdfs.SEQ ); URI associatedURI = values.createURI( manyAssociationType.qualifiedName().toURI() ); graph.add( associationURI, Rdfs.RANGE, associatedURI ); graph.add( associationURI, Rdfs.RANGE, XMLSchema.ANYURI ); } ); }
@Override public Resource export(final Graph graph) { final Resource implNode = super.export(graph); @SuppressWarnings("deprecation") final ValueFactory v = graph.getValueFactory(); graph.add(implNode, USER, v.createLiteral(user)); graph.add(implNode, PASSWORD, v.createLiteral(password)); graph.add(implNode, INSTANCE, v.createLiteral(instance)); graph.add(implNode, ZOOKEEPERS, v.createLiteral(zookeepers)); graph.add(implNode, IS_MOCK, v.createLiteral(isMock)); return implNode; }
@Override public Resource export(Graph graph) { Resource implNode = super.export(graph); ValueFactory vf = graph.getValueFactory(); if (jdbcDriver != null) { graph.add(implNode, JDBC_DRIVER, vf.createLiteral(jdbcDriver)); } if (url != null) { graph.add(implNode, URL, vf.createLiteral(url)); } if (user != null) { graph.add(implNode, USER, vf.createLiteral(user)); } if (password != null) { graph.add(implNode, PASSWORD, vf.createLiteral(password)); } graph.add(implNode, MAX_TRIPLE_TABLES, vf.createLiteral(maxTripleTables)); return implNode; }
public Iterable<Statement> serialize( final EntityDescriptor entityDescriptor ) { Graph graph = new GraphImpl(); ValueFactory values = graph.getValueFactory(); URI entityTypeUri = values.createURI( Classes.toURI( first( entityDescriptor.types() ) ) ); graph.add( entityTypeUri, Rdfs.TYPE, Rdfs.CLASS ); graph.add( entityTypeUri, Rdfs.TYPE, OWL.CLASS ); graph.add( entityTypeUri, Qi4jEntityType.TYPE, values.createLiteral( first( entityDescriptor.types() ).toString() ) ); graph.add( entityTypeUri, Qi4jEntityType.QUERYABLE, values.createLiteral( entityDescriptor.queryable() ) ); serializeMixinTypes( entityDescriptor, graph, entityTypeUri ); serializePropertyTypes( entityDescriptor, graph, entityTypeUri ); serializeAssociationTypes( entityDescriptor, graph, entityTypeUri ); serializeManyAssociationTypes( entityDescriptor, graph, entityTypeUri ); return graph; }
private void serializeManyAssociationTypes( final EntityDescriptor entityDescriptor, final Graph graph, final URI entityTypeUri ) { ValueFactory values = graph.getValueFactory(); // ManyAssociations for( AssociationDescriptor manyAssociationType : entityDescriptor.state().manyAssociations() ) { URI associationURI = values.createURI( manyAssociationType.qualifiedName().toURI() ); graph.add( associationURI, Rdfs.DOMAIN, entityTypeUri ); graph.add( associationURI, Rdfs.TYPE, Rdfs.SEQ ); URI associatedURI = values.createURI( manyAssociationType.qualifiedName().toURI() ); graph.add( associationURI, Rdfs.RANGE, associatedURI ); graph.add( associationURI, Rdfs.RANGE, XMLSchema.ANYURI ); } }
private void serializeAssociationTypes( final EntityDescriptor entityDescriptor, final Graph graph, final URI entityTypeUri ) { ValueFactory values = graph.getValueFactory(); // Associations for( AssociationDescriptor associationType : entityDescriptor.state().associations() ) { URI associationURI = values.createURI( associationType.qualifiedName().toURI() ); graph.add( associationURI, Rdfs.DOMAIN, entityTypeUri ); graph.add( associationURI, Rdfs.TYPE, Rdfs.PROPERTY ); URI associatedURI = values.createURI( Classes.toURI( Classes.RAW_CLASS.map( associationType.type() ) ) ); graph.add( associationURI, Rdfs.RANGE, associatedURI ); graph.add( associationURI, Rdfs.RANGE, XMLSchema.ANYURI ); } }