├── .gitignore ├── .gitlab-ci.yml ├── LICENSE ├── LICENSE-fr ├── README.md ├── config ├── findbugs │ └── exclude-filter.xml └── pmd-rulesets │ ├── basic.xml │ ├── design.xml │ ├── finalizers.xml │ ├── imports.xml │ ├── naming.xml │ ├── strictexception.xml │ ├── strings.xml │ └── unusedcode.xml ├── docs └── dev │ └── RELEASE-PROCESS.txt ├── graal-api ├── config ├── pom.xml └── src │ └── main │ └── java │ └── fr │ └── lirmm │ └── graphik │ └── graal │ └── api │ ├── backward_chaining │ ├── QueryRewriter.java │ └── QueryRewriterWithCompilation.java │ ├── core │ ├── AbstractAtom.java │ ├── AbstractTerm.java │ ├── Atom.java │ ├── AtomSet.java │ ├── AtomSetException.java │ ├── ConjunctiveQuery.java │ ├── ConjunctiveQueryWithNegatedParts.java │ ├── Constant.java │ ├── ConstantGenerator.java │ ├── EffectiveConjunctiveQuery.java │ ├── EffectiveQuery.java │ ├── FreshVarMapper.java │ ├── GraphOfRuleDependencies.java │ ├── ImmutableRuleSet.java │ ├── InMemoryAtomSet.java │ ├── InMemoryKnowledgeBase.java │ ├── Literal.java │ ├── NegativeConstraint.java │ ├── Ontology.java │ ├── Predicate.java │ ├── Query.java │ ├── QueryLabeler.java │ ├── Rule.java │ ├── RuleLabeler.java │ ├── RuleSet.java │ ├── RuleSetException.java │ ├── RulesCompilation.java │ ├── Substitution.java │ ├── Term.java │ ├── TermGenerator.java │ ├── UnionOfConjunctiveQueries.java │ ├── UnsupportedAtomTypeException.java │ ├── Variable.java │ ├── VariableGenerator.java │ ├── mapper │ │ ├── AtomMapper.java │ │ ├── Mapper.java │ │ ├── MutableMapper.java │ │ ├── PredicateMapper.java │ │ └── TermMapper.java │ └── unifier │ │ ├── AbstractUnifierChecker.java │ │ ├── DependencyChecker.java │ │ ├── UnifierAlgorithm.java │ │ └── UnifierChecker.java │ ├── factory │ ├── AtomFactory.java │ ├── ConjunctiveQueryFactory.java │ ├── InMemoryAtomSetFactory.java │ ├── PredicateFactory.java │ ├── RuleFactory.java │ ├── StoreFactory.java │ ├── SubstitutionFactory.java │ └── TermFactory.java │ ├── forward_chaining │ ├── AbstractChase.java │ ├── AbstractDirectChase.java │ ├── Chase.java │ ├── ChaseException.java │ ├── ChaseHaltingCondition.java │ ├── DirectRuleApplier.java │ ├── RuleApplicationException.java │ ├── RuleApplicationHandler.java │ ├── RuleApplicationHandlerException.java │ └── RuleApplier.java │ ├── homomorphism │ ├── AbstractChecker.java │ ├── ExistentialHomomorphism.java │ ├── ExistentialHomomorphismChecker.java │ ├── ExistentialHomomorphismPattern.java │ ├── ExistentialHomomorphismWithCompilation.java │ ├── Homomorphism.java │ ├── HomomorphismChecker.java │ ├── HomomorphismException.java │ ├── HomomorphismFactoryException.java │ ├── HomomorphismPattern.java │ ├── HomomorphismWithCompilation.java │ ├── PreparedExistentialHomomorphism.java │ └── PreparedHomomorphism.java │ ├── io │ ├── AbstractGraalWriter.java │ ├── AbstractWriter.java │ ├── AtomSetWriter.java │ ├── AtomWriter.java │ ├── ConjunctiveQueryParser.java │ ├── ConjunctiveQueryWriter.java │ ├── GraalWriter.java │ ├── NegativeConstraintWriter.java │ ├── ParseError.java │ ├── ParseException.java │ ├── Parser.java │ ├── RuleWriter.java │ ├── Writer.java │ └── WriterException.java │ ├── kb │ ├── Approach.java │ ├── KnowledgeBase.java │ └── KnowledgeBaseException.java │ ├── store │ ├── BatchProcessor.java │ ├── Store.java │ ├── TripleStore.java │ └── WrongArityException.java │ └── util │ └── TimeoutException.java ├── graal-backward-chaining ├── config ├── pom.xml └── src │ ├── main │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── backward_chaining │ │ └── pure │ │ ├── AbstractRewritingOperator.java │ │ ├── AggregAllRulesOperator.java │ │ ├── AggregSingleRuleOperator.java │ │ ├── BasicAggregAllRulesOperator.java │ │ ├── MarkedQuery.java │ │ ├── PureQuery.java │ │ ├── PureRewriter.java │ │ ├── RewritingAlgorithm.java │ │ ├── RewritingIterator.java │ │ ├── RewritingOperator.java │ │ └── Utils.java │ └── test │ └── java │ └── fr │ └── lirmm │ └── graphik │ └── graal │ └── backward_chaining │ ├── BackwardChainingTest.java │ └── pure │ ├── FreeVarSubstitutionTest.java │ ├── MiscTest.java │ └── TestUtils.java ├── graal-builtin-predicates ├── config ├── pom.xml └── src │ ├── main │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ ├── api │ │ ├── core │ │ │ ├── BuiltInPredicate.java │ │ │ ├── BuiltInPredicateSet.java │ │ │ ├── ConjunctiveQueryWithBuiltInPredicates.java │ │ │ └── RuleWithBuiltInPredicate.java │ │ └── util │ │ │ └── ClassicBuiltInPredicates.java │ │ ├── converter │ │ └── Object2RuleWithBuiltInPredicateConverter.java │ │ ├── core │ │ ├── BuiltInAtomSetBuilder.java │ │ ├── DefaultBuiltInPredicateSet.java │ │ ├── DefaultConjunctiveQueryWithBuiltInPredicates.java │ │ └── DefaultRuleWithBuiltInPredicates.java │ │ ├── forward_chaining │ │ └── rule_applier │ │ │ └── RuleWithBuiltInPredicateApplier.java │ │ └── homomorphism │ │ ├── ConjunctiveQueryWithBuiltInPredicatesHomomorphism.java │ │ └── checker │ │ └── ConjunctiveQueryWithBuiltInPredicatesChecker.java │ └── test │ └── java │ └── fr │ └── lirmm │ └── graphik │ └── graal │ └── homomorphism │ └── ConjunctiveQueryWBPHomomorphismTest.java ├── graal-core ├── .gitignore ├── config ├── pom.xml └── src │ ├── main │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ ├── GraalConstant.java │ │ └── core │ │ ├── AbstractMapBasedSubstitution.java │ │ ├── AbstractRule.java │ │ ├── AbstractSubstitution.java │ │ ├── AtomType.java │ │ ├── ConjunctiveQueryRuleAdapter.java │ │ ├── DefaultAtom.java │ │ ├── DefaultConjunctiveQuery.java │ │ ├── DefaultConjunctiveQueryWithNegatedParts.java │ │ ├── DefaultConstantGenerator.java │ │ ├── DefaultEffectiveConjunctiveQuery.java │ │ ├── DefaultEffectiveQuery.java │ │ ├── DefaultFreshVarMapper.java │ │ ├── DefaultNegativeConstraint.java │ │ ├── DefaultQueryLabeler.java │ │ ├── DefaultRule.java │ │ ├── DefaultRuleLabeler.java │ │ ├── DefaultUnionOfConjunctiveQueries.java │ │ ├── DefaultVariableGenerator.java │ │ ├── EmptySubstitution.java │ │ ├── FreshVarSubstitution.java │ │ ├── HashMapSubstitution.java │ │ ├── LabelRuleComparator.java │ │ ├── RuleWrapper2ConjunctiveQueryWithNegatedParts.java │ │ ├── Rules.java │ │ ├── StoredVariableGenerator.java │ │ ├── Substitutions.java │ │ ├── TreeMapSubstitution.java │ │ ├── TypeFilter.java │ │ ├── VariablePrefixSubstitution.java │ │ ├── VariableRemovePrefixSubstitution.java │ │ ├── atomset │ │ ├── AbstractAtomSet.java │ │ ├── AbstractImmutableAtomSet.java │ │ ├── AbstractInMemoryAtomSet.java │ │ ├── AtomSetUtils.java │ │ ├── LinkedListAtomSet.java │ │ └── graph │ │ │ ├── AbstractTermVertex.java │ │ │ ├── AtomEdge.java │ │ │ ├── AtomEdgeFactory.java │ │ │ ├── ConstantVertex.java │ │ │ ├── CurrentIndexFactory.java │ │ │ ├── DefaultInMemoryGraphStore.java │ │ │ ├── Edge.java │ │ │ ├── HashIndexFactory.java │ │ │ ├── IndexFactory.java │ │ │ ├── LiteralVertex.java │ │ │ ├── PredicateVertex.java │ │ │ ├── TermVertex.java │ │ │ ├── TermVertexFactory.java │ │ │ ├── TreeIndexFactory.java │ │ │ ├── VariableVertex.java │ │ │ ├── Vertex.java │ │ │ └── VertexComparator.java │ │ ├── compilation │ │ ├── AbstractRulesCompilation.java │ │ ├── HierarchicalCompilation.java │ │ ├── IDCompilation.java │ │ ├── IDCondition.java │ │ ├── IDConditionImpl.java │ │ └── NoCompilation.java │ │ ├── factory │ │ ├── DefaultAtomFactory.java │ │ ├── DefaultAtomSetFactory.java │ │ ├── DefaultConjunctiveQueryFactory.java │ │ ├── DefaultPredicateFactory.java │ │ ├── DefaultRuleFactory.java │ │ ├── DefaultStoreFactory.java │ │ └── DefaultSubstitutionFactory.java │ │ ├── filter │ │ ├── ConstantFilter.java │ │ ├── LiteralFilter.java │ │ └── VariableFilter.java │ │ ├── mapper │ │ ├── AbstractMapper.java │ │ ├── HashMapMapper.java │ │ ├── IdentityMapper.java │ │ ├── InverseAtomMapper.java │ │ ├── InverseMapper.java │ │ ├── MappedRuleSet.java │ │ ├── MappedStore.java │ │ ├── MapperAtomConverter.java │ │ ├── MapperPredicateConverter.java │ │ ├── MapperRuleConverter.java │ │ ├── PrefixMapper.java │ │ └── RDFTypeMapper.java │ │ ├── package-info.java │ │ ├── ruleset │ │ ├── AbstractRuleSet.java │ │ ├── DefaultOntology.java │ │ ├── IndexedByBodyPredicatesRuleSet.java │ │ ├── IndexedByHeadPredicatesRuleSet.java │ │ └── LinkedListRuleSet.java │ │ ├── store │ │ ├── AbstractStore.java │ │ ├── AbstractTripleStore.java │ │ ├── DefaultBatchProcessor.java │ │ └── GraphDBStore.java │ │ ├── stream │ │ ├── ConjunctiveQuery2EffCQJavaIterator.java │ │ ├── EffCQ2ConjunctiveQueryJavaIterator.java │ │ ├── SubstitutionIterator2AtomIterator.java │ │ └── filter │ │ │ ├── AtomFilter.java │ │ │ ├── AtomFilterIterator.java │ │ │ ├── ConjunctiveQueryFilter.java │ │ │ ├── ConjunctiveQueryFilterIterator.java │ │ │ ├── NegativeConstraintFilter.java │ │ │ ├── NegativeConstraintFilterIterator.java │ │ │ ├── RuleFilter.java │ │ │ └── RuleFilterIterator.java │ │ ├── term │ │ ├── DefaultConstant.java │ │ ├── DefaultLiteral.java │ │ ├── DefaultTermFactory.java │ │ └── DefaultVariable.java │ │ └── unifier │ │ ├── AtomicAtomSet.java │ │ ├── AtomicHeadRule.java │ │ ├── DefaultUnifierAlgorithm.java │ │ ├── QueryUnifier.java │ │ ├── RuleDependencyUtils.java │ │ ├── TermPartitionUtils.java │ │ ├── Unifier.java │ │ ├── UnifierIterator.java │ │ ├── UnifierUtils.java │ │ └── checker │ │ └── AtomErasingChecker.java │ └── test │ └── java │ └── fr │ └── lirmm │ └── graphik │ └── graal │ └── core │ ├── AtomTest.java │ ├── PredicateTest.java │ ├── RuleSetTest.java │ ├── RuleTest.java │ ├── SubstitutionTest.java │ ├── TermTest.java │ ├── TestUtils.java │ ├── UnifierTest.java │ ├── compilation │ ├── IDCompilationTest.java │ └── IDConditionTest.java │ ├── mapper │ └── PrefixMapperTest.java │ ├── ruleset │ └── DefaultOntologyTest.java │ └── term │ ├── AtomTest.java │ └── TermTest.java ├── graal-coverage ├── config └── pom.xml ├── graal-forward-chaining ├── config ├── pom.xml └── src │ ├── main │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── forward_chaining │ │ ├── BasicChase.java │ │ ├── BreadthFirstChase.java │ │ ├── halting_condition │ │ ├── FrontierRestrictedChaseHaltingCondition.java │ │ ├── HaltingConditionWithHandler.java │ │ └── RestrictedChaseHaltingCondition.java │ │ └── rule_applier │ │ ├── AbstractRuleApplier.java │ │ ├── DefaultRuleApplier.java │ │ ├── DefaultRuleApplierWithCompilation.java │ │ ├── ExhaustiveRuleApplier.java │ │ ├── RestrictedChaseRuleApplier.java │ │ └── RuleApplierIterator.java │ └── test │ └── java │ └── fr │ └── lirmm │ └── graphik │ └── graal │ └── forward_chaining │ └── halting_condition │ ├── ChaseTest.java │ └── FrontierRestrictedChaseHaltingConditionTest.java ├── graal-grd ├── config ├── pom.xml └── src │ ├── main │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ ├── core │ │ ├── grd │ │ │ └── DefaultGraphOfRuleDependencies.java │ │ └── unifier │ │ │ └── checker │ │ │ ├── ProductivityChecker.java │ │ │ └── RestrictedProductivityChecker.java │ │ └── forward_chaining │ │ ├── ChaseWithGRD.java │ │ ├── ChaseWithGRDAndUnfiers.java │ │ ├── SccChase.java │ │ └── StaticChase.java │ └── test │ └── java │ └── fr │ └── lirmm │ └── graphik │ └── graal │ └── core │ └── grd │ ├── ChaseWithGRDAndCompilationTest.java │ ├── GRDTest.java │ ├── RestrictedProductivityCheckerTest.java │ ├── SccChaseWithCompilationTest.java │ └── TestUtils.java ├── graal-homomorphism ├── config ├── pom.xml └── src │ ├── main │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── homomorphism │ │ ├── AbstractHomomorphism.java │ │ ├── AbstractHomomorphismWithCompilation.java │ │ ├── Atom2SubstitutionConverter.java │ │ ├── AtomicQueryHomomorphism.java │ │ ├── AtomicQueryHomomorphismWithNegatedParts.java │ │ ├── BacktrackException.java │ │ ├── BacktrackHomomorphism.java │ │ ├── BacktrackHomomorphismPattern.java │ │ ├── BacktrackHomomorphismWithNegatedParts.java │ │ ├── BacktrackIterator.java │ │ ├── BacktrackIteratorData.java │ │ ├── DefaultUCQHomomorphism.java │ │ ├── FullyInstantiatedQueryHomomorphism.java │ │ ├── NegFilter.java │ │ ├── PreparedBacktrackHomomorphism.java │ │ ├── PureHomomorphism.java │ │ ├── PureHomomorphismImpl.java │ │ ├── SmartHomomorphism.java │ │ ├── UnionConjunctiveQueriesSubstitutionIterator.java │ │ ├── Var.java │ │ ├── VarSharedData.java │ │ ├── backjumping │ │ ├── BackJumping.java │ │ ├── GraphBaseBackJumping.java │ │ └── NoBackJumping.java │ │ ├── bbc │ │ ├── BCC.java │ │ ├── BCCBackJumping.java │ │ ├── BCCScheduler.java │ │ ├── IntegerComparator.java │ │ └── VarData.java │ │ ├── bootstrapper │ │ ├── AllDomainBootstrapper.java │ │ ├── Bootstrapper.java │ │ ├── BootstrapperUtils.java │ │ ├── DefaultBootstrapper.java │ │ ├── StarBootstrapper.java │ │ └── StatBootstrapper.java │ │ ├── checker │ │ ├── AtomicQueryHomomorphismChecker.java │ │ ├── AtomicQueryHomomorphismWithNegatedPartsChecker.java │ │ ├── BacktrackChecker.java │ │ ├── BacktrackWithNegatedPartsChecker.java │ │ ├── DefaultUnionConjunctiveQueriesChecker.java │ │ └── FullyInstantiatedQueryHomomorphismChecker.java │ │ ├── forward_checking │ │ ├── AbstractNFC.java │ │ ├── ForwardChecking.java │ │ ├── NFC0.java │ │ ├── NFC2.java │ │ ├── NFC2WithLimit.java │ │ ├── NoForwardChecking.java │ │ └── SimpleFC.java │ │ ├── scheduler │ │ ├── AbstractScheduler.java │ │ ├── ComparableOrderScheduler.java │ │ ├── DefaultScheduler.java │ │ ├── FixedOrderScheduler.java │ │ └── Scheduler.java │ │ └── utils │ │ ├── BacktrackUtils.java │ │ ├── EqualityHandlerConverter.java │ │ ├── EqualityUtils.java │ │ ├── HomomorphismIteratorChecker.java │ │ └── ProbaUtils.java │ └── test │ └── java │ └── fr │ └── lirmm │ └── graphik │ └── graal │ └── homomorphism │ ├── Atom2SubstitutionConverterTest.java │ ├── BackjumpTest.java │ ├── EqualityUtilsTest.java │ ├── ForwardCheckingTest.java │ ├── HomomorphismTest.java │ ├── HomomorphismWithNegatedPartsTest.java │ ├── PureHomomorphismTest.java │ └── TestUtil.java ├── graal-io ├── config ├── graal-io-dlgp │ ├── config │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── fr │ │ │ └── lirmm │ │ │ └── graphik │ │ │ └── graal │ │ │ └── io │ │ │ └── dlp │ │ │ ├── AbstractDlgpListener.java │ │ │ ├── AtomCloseableIteratorWrapperHandlingParseException.java │ │ │ ├── Directive.java │ │ │ ├── DlgpGrammarUtils.java │ │ │ ├── DlgpListener.java │ │ │ ├── DlgpParseException.java │ │ │ ├── DlgpParser.java │ │ │ ├── DlgpWriter.java │ │ │ ├── InternalTermFactory.java │ │ │ └── Producer.java │ │ └── test │ │ ├── java │ │ └── fr │ │ │ └── lirmm │ │ │ └── graphik │ │ │ └── graal │ │ │ └── io │ │ │ └── dlp │ │ │ ├── DlgpParserTest.java │ │ │ └── DlgpWriterTest.java │ │ └── resources │ │ ├── correct.dlp │ │ ├── irisAndLiterals.dlp │ │ └── simple.dlp ├── graal-io-owl │ ├── config │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── fr │ │ │ └── lirmm │ │ │ └── graphik │ │ │ └── graal │ │ │ └── io │ │ │ └── owl │ │ │ ├── GraalUtils.java │ │ │ ├── OWL2Parser.java │ │ │ ├── OWL2ParserException.java │ │ │ ├── OWLAPIUtils.java │ │ │ ├── OWLAxiomParser.java │ │ │ ├── OWLEquivalentClassExpressionVisitor.java │ │ │ ├── OWLEquivalentClassExpressionVisitorImpl.java │ │ │ ├── OWLEquivalentDataRangeVisitor.java │ │ │ ├── OWLEquivalentDataRangeVisitorImpl.java │ │ │ ├── OWLPropertyExpressionVisitorImpl.java │ │ │ └── UnsupportedConstructor.java │ │ └── test │ │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── io │ │ └── owl │ │ └── test │ │ └── OWL2ParserTest.java ├── graal-io-rdf │ ├── config │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── io │ │ └── rdf │ │ ├── AbstractRDFListener.java │ │ ├── Producer.java │ │ ├── RDFListener.java │ │ ├── RDFParser.java │ │ └── RDFWriter.java ├── graal-io-ruleml │ ├── config │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── io │ │ └── ruleml │ │ └── RuleMLWriter.java ├── graal-io-sparql │ ├── config │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── fr │ │ │ └── lirmm │ │ │ └── graphik │ │ │ └── graal │ │ │ └── io │ │ │ └── sparql │ │ │ ├── AbstractSparqlWriter.java │ │ │ ├── ElementVisitorImpl.java │ │ │ ├── SparqlConjunctiveQueryParser.java │ │ │ ├── SparqlConjunctiveQueryWriter.java │ │ │ ├── SparqlRuleParser.java │ │ │ ├── SparqlRuleWriter.java │ │ │ └── SparqlUtils.java │ │ └── test │ │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── io │ │ └── sparql │ │ ├── AbstractSparqlWriterTest.java │ │ ├── SparqlConjunctiveQueryTest.java │ │ └── SparqlRuleTest.java └── pom.xml ├── graal-kb ├── config ├── pom.xml └── src │ ├── main │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── kb │ │ ├── DefaultKnowledgeBase.java │ │ ├── KBBuilder.java │ │ └── KBBuilderException.java │ └── test │ └── java │ └── fr │ └── lirmm │ └── graphik │ └── graal │ └── kb │ ├── DefaultKnowledgeBaseQueryTest.java │ ├── DefaultKnowledgeBaseTest.java │ └── KBBuilderTest.java ├── graal-keyvalue ├── graal-key-value-core │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── fr │ │ │ └── lirmm │ │ │ └── graphik │ │ │ └── graal │ │ │ └── converter │ │ │ └── KVDlgp2StoreConverter.java │ │ └── test │ │ ├── java │ │ └── fr │ │ │ └── lirmm │ │ │ └── graphik │ │ │ └── graal │ │ │ └── converter │ │ │ └── KVDlgp2StoreConverterTest.java │ │ └── resources │ │ └── ontologies │ │ ├── persons.dlp │ │ └── persons_result.dlp └── pom.xml ├── graal-rules-analyser ├── TODO ├── config ├── pom.xml └── src │ ├── main │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── rulesetanalyser │ │ ├── Analyser.java │ │ ├── RuleSetPropertyHierarchy.java │ │ ├── graph │ │ ├── AbstractAffectedPositionSet.java │ │ ├── AffectedPositionSet.java │ │ ├── GraphPositionDependencies.java │ │ ├── JointlyAffectedPositionSet.java │ │ └── MarkedVariableSet.java │ │ ├── property │ │ ├── AGRDProperty.java │ │ ├── BTSProperty.java │ │ ├── DisconnectedProperty.java │ │ ├── DomainRestrictedProperty.java │ │ ├── FESProperty.java │ │ ├── FUSProperty.java │ │ ├── FrontierGuardedProperty.java │ │ ├── FrontierOneProperty.java │ │ ├── GBTSProperty.java │ │ ├── GuardedProperty.java │ │ ├── JointlyFrontierGuardedSetProperty.java │ │ ├── LinearProperty.java │ │ ├── MFAProperty.java │ │ ├── MSAProperty.java │ │ ├── RangeRestrictedProperty.java │ │ ├── RuleSetProperty.java │ │ ├── StickyProperty.java │ │ ├── WeaklyAcyclicProperty.java │ │ ├── WeaklyFrontierGuardedSetProperty.java │ │ ├── WeaklyGuardedSetProperty.java │ │ └── WeaklyStickyProperty.java │ │ └── util │ │ ├── AnalyserRuleSet.java │ │ └── PredicatePosition.java │ └── test │ ├── java │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── rulesetanalyser │ │ ├── AnalyserRuleSetTest.java │ │ └── PropertyTest.java │ └── resources │ ├── test.grd │ └── univ-bench.grd ├── graal-sparql-homomorphism ├── config ├── pom.xml └── src │ ├── main │ └── java │ │ └── src │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── homomorphism │ │ └── SPARQLHomomorphism.java │ └── test │ ├── java │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── homomorphism │ │ └── SparqlHomomorphismTest.java │ └── resources │ └── ontologies │ ├── noprefix.dlp │ ├── noprefix_result.dlp │ ├── persons.dlp │ └── persons_result.dlp ├── graal-store ├── config ├── graal-store-dictionary │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ ├── fr │ │ │ └── lirmm │ │ │ │ └── graphik │ │ │ │ └── graal │ │ │ │ └── store │ │ │ │ └── rdbms │ │ │ │ └── adhoc │ │ │ │ ├── DictionaryAdHocConjectiveQueryTranslator.java │ │ │ │ └── DictionaryAdHocRdbmsStore.java │ │ │ └── org │ │ │ └── graal │ │ │ └── store │ │ │ └── dictionary │ │ │ ├── DictionaryInMemoryGraphStore.java │ │ │ ├── DictionaryMapper.java │ │ │ ├── DictionaryMapping.java │ │ │ ├── DictionnaryMappingException.java │ │ │ ├── MapperSubstitutionConverter.java │ │ │ ├── TreeMapDictionaryMapper.java │ │ │ └── TrieDictionaryMapper.java │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── graal │ │ │ └── store │ │ │ └── dictionary │ │ │ └── DictionaryMappingTest.java │ │ └── resources │ │ └── animals.dlp ├── graal-store-neo4j │ ├── config │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── store │ │ └── gdb │ │ └── Neo4jStore.java ├── graal-store-rdbms │ ├── config │ ├── pom.xml │ ├── rdbms-adhoc │ │ ├── config │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── fr │ │ │ └── lirmm │ │ │ └── graphik │ │ │ └── graal │ │ │ └── store │ │ │ └── rdbms │ │ │ └── adhoc │ │ │ ├── AdHocConjunctiveQueryTranslator.java │ │ │ ├── AdHocRdbmsBatchProcessor.java │ │ │ ├── AdHocRdbmsStore.java │ │ │ ├── AdHocResultSet2PredicateConverter.java │ │ │ ├── AdHocResultSet2TermConverter.java │ │ │ ├── AdHocResultSetPredicateIterator.java │ │ │ └── AdHocResultSetTermIterator.java │ ├── rdbms-common │ │ ├── config │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── fr │ │ │ └── lirmm │ │ │ └── graphik │ │ │ └── graal │ │ │ └── store │ │ │ └── rdbms │ │ │ ├── AbstractRdbmsBatchProcessor.java │ │ │ ├── AbstractRdbmsConjunctiveQueryTranslator.java │ │ │ ├── AbstractRdbmsStore.java │ │ │ ├── RdbmsAtomIterator.java │ │ │ ├── RdbmsConjunctiveQueryTranslator.java │ │ │ ├── RdbmsConstantGenenrator.java │ │ │ ├── RdbmsStore.java │ │ │ ├── RdbmsVariableGenenrator.java │ │ │ ├── ResultSetSubstitution.java │ │ │ ├── driver │ │ │ ├── AbstractInsertOrIgnoreRdbmsDriver.java │ │ │ ├── AbstractMergeRdbmsDriver.java │ │ │ ├── AbstractRdbmsDriver.java │ │ │ ├── HSQLDBDriver.java │ │ │ ├── MysqlDriver.java │ │ │ ├── PostgreSQLDriver.java │ │ │ ├── RdbmsDriver.java │ │ │ ├── ResultSet2DBTableConverter.java │ │ │ └── SqliteDriver.java │ │ │ ├── homomorphism │ │ │ ├── ResultSet2SubstitutionConverter.java │ │ │ ├── SqlHomomorphism.java │ │ │ ├── SqlHomomorphismChecker.java │ │ │ ├── SqlUCQHomomorphism.java │ │ │ └── SqlUCQHomomorphismChecker.java │ │ │ ├── rule_applier │ │ │ └── SQLRuleApplier.java │ │ │ └── util │ │ │ ├── DBColumn.java │ │ │ ├── DBTable.java │ │ │ ├── ResultSetCloseableIterator.java │ │ │ ├── ResultSetConverterIterator.java │ │ │ └── SQLQuery.java │ ├── rdbms-natural │ │ ├── config │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── fr │ │ │ └── lirmm │ │ │ └── graphik │ │ │ └── graal │ │ │ └── store │ │ │ └── rdbms │ │ │ └── natural │ │ │ ├── DBTable2PredicateConverter.java │ │ │ ├── NaturalBatchProcessor.java │ │ │ ├── NaturalConjunctiveQueryTranslator.java │ │ │ ├── NaturalRDBMSStore.java │ │ │ ├── NaturalResultSet2TermConverter.java │ │ │ └── NaturalResultSetTermIterator.java │ └── rdbms-test │ │ ├── config │ │ ├── pom.xml │ │ └── src │ │ └── test │ │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── rdbms │ │ └── store │ │ └── test │ │ ├── RdbmsStoreTest.java │ │ ├── SQLHomomorphismTest.java │ │ └── TestUtil.java ├── graal-store-rdf4j │ ├── config │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ └── store │ │ └── triplestore │ │ └── rdf4j │ │ ├── AbstractTupleQueryResultIterator.java │ │ ├── AtomIterator.java │ │ ├── PredicatesIterator.java │ │ ├── RDF4jStore.java │ │ ├── StatementIterator.java │ │ ├── TermsIterator.java │ │ ├── TupleQueryResult2SubstitutionConverter.java │ │ ├── TupleQueryResultAtomIterator.java │ │ └── TupleQueryResultCloseableIterator.java └── pom.xml ├── graal-test ├── config ├── pom.xml └── src │ └── test │ ├── java │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── graal │ │ ├── core │ │ ├── InMemoryAtomSetTest.java │ │ └── mapper │ │ │ └── RDFTypeMapperTest.java │ │ ├── forward_chaining │ │ ├── ChaseTest.java │ │ └── SaturationWithCompilationTest.java │ │ ├── store │ │ └── test │ │ │ ├── ConjunctiveQuery2Test.java │ │ │ ├── ConjunctiveQueryFixedBugTest.java │ │ │ ├── ConjunctiveQueryTest.java │ │ │ ├── ConjunctiveQueryWithCompilation.java │ │ │ ├── LiteralsTest.java │ │ │ ├── NoTripleStoreTest.java │ │ │ ├── StoreTest.java │ │ │ └── TripleStoreTest.java │ │ └── test │ │ ├── HierachicalCompilationFactory.java │ │ ├── IDCompilationFactory.java │ │ ├── RulesCompilationFactory.java │ │ └── TestUtil.java │ └── resources │ └── ontologies │ ├── 1.dlp │ ├── 1_compile-result.dlp │ ├── 1_result.dlp │ ├── 2.dlp │ ├── 2_compile-result.dlp │ ├── 2_result.dlp │ ├── 3.dlp │ ├── 3_compile-result.dlp │ └── 3_result.dlp ├── graal-util ├── config ├── pom.xml └── src │ ├── main │ └── java │ │ └── fr │ │ └── lirmm │ │ └── graphik │ │ └── util │ │ ├── Apps.java │ │ ├── ArrayIterator.java │ │ ├── DefaultURI.java │ │ ├── EquivalentRelation.java │ │ ├── LinkedSet.java │ │ ├── MathUtils.java │ │ ├── MethodNotImplementedError.java │ │ ├── Partition.java │ │ ├── Prefix.java │ │ ├── PrefixManager.java │ │ ├── ShouldNeverHappenedError.java │ │ ├── TimeUnit.java │ │ ├── TreeMapEquivalentRelation.java │ │ ├── URI.java │ │ ├── URIUtils.java │ │ ├── URIzer.java │ │ ├── collections │ │ ├── ListComparator.java │ │ ├── Trie.java │ │ └── TrieNode.java │ │ ├── graph │ │ ├── DefaultDirectedEdge.java │ │ ├── DefaultDirectedGraph.java │ │ ├── DefaultEdge.java │ │ ├── DefaultGraph.java │ │ ├── DefaultHyperEdge.java │ │ ├── DefaultHyperGraph.java │ │ ├── DirectedEdge.java │ │ ├── DirectedGraph.java │ │ ├── Edge.java │ │ ├── Graph.java │ │ ├── HyperEdge.java │ │ ├── HyperGraph.java │ │ ├── algorithm │ │ │ ├── BiconnectedComponents.java │ │ │ └── BiconnectedComponentsForHyperGraph.java │ │ └── scc │ │ │ └── StronglyConnectedComponentsGraph.java │ │ ├── profiler │ │ ├── AbstractProfilable.java │ │ ├── AbstractProfiler.java │ │ ├── CPUTimeProfiler.java │ │ ├── NoProfiler.java │ │ ├── Profilable.java │ │ ├── Profiler.java │ │ └── RealTimeProfiler.java │ │ ├── stream │ │ ├── AbstractCloseableIterator.java │ │ ├── ArrayBlockingQueueToCloseableIteratorAdapter.java │ │ ├── ArrayBlockingStream.java │ │ ├── ArrayCloseableIterator.java │ │ ├── CloseableIterable.java │ │ ├── CloseableIterableAdapter.java │ │ ├── CloseableIterableWithoutException.java │ │ ├── CloseableIterator.java │ │ ├── CloseableIteratorAccumulator.java │ │ ├── CloseableIteratorAdapter.java │ │ ├── CloseableIteratorAggregator.java │ │ ├── CloseableIteratorAggregatorWithoutException.java │ │ ├── CloseableIteratorRecursive.java │ │ ├── CloseableIteratorWithoutException.java │ │ ├── CounterIterator.java │ │ ├── EmptyCloseableIteratorWithoutException.java │ │ ├── InMemoryStream.java │ │ ├── IterableAdapter.java │ │ ├── IteratorAdapter.java │ │ ├── IteratorException.java │ │ ├── Iterators.java │ │ ├── LinkedBlockingStream.java │ │ ├── QueueStream.java │ │ ├── SingletonCloseableIteratorWithoutException.java │ │ ├── Stream.java │ │ ├── UniqIterator.java │ │ ├── Writer.java │ │ ├── converter │ │ │ ├── ConversionException.java │ │ │ ├── Converter.java │ │ │ ├── ConverterCloseableIterator.java │ │ │ ├── ConverterIterator.java │ │ │ └── ConverterIteratorWithoutException.java │ │ ├── filter │ │ │ ├── AndFilter.java │ │ │ ├── FalseFilter.java │ │ │ ├── Filter.java │ │ │ ├── FilterCloseableIterator.java │ │ │ ├── FilterIterator.java │ │ │ ├── FilterIteratorWithoutException.java │ │ │ ├── Filters.java │ │ │ ├── OrFilter.java │ │ │ ├── TrueFilter.java │ │ │ └── UniqFilter.java │ │ └── transformator │ │ │ └── Transformator.java │ │ └── string │ │ ├── AppendableToStringBuilder.java │ │ ├── NumberStringComparator.java │ │ └── StringUtils.java │ └── test │ └── java │ └── fr │ └── lirmm │ └── graphik │ └── util │ ├── collections │ └── TrieTest.java │ └── graph │ └── BiconnectedComponentsTest.java ├── pom.xml ├── prepare_ant.sh ├── rdf4j-common ├── config ├── pom.xml └── src │ └── main │ └── java │ └── fr │ └── lirmm │ └── graphik │ └── graal │ └── common │ └── rdf4j │ ├── MalformedLangStringException.java │ ├── RDF4jUtils.java │ └── RDFTypeAtomMapper.java └── scripts ├── build.xml.prefix ├── build.xml.suffix ├── dep-list ├── dep-list-create.sh ├── kiabora_combiner.sh ├── kiabora_to_combine.pl └── wget-dep.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # SPECIFIC DIRECTORY # 2 | ###################### 3 | graal-examples/src/main/java/fr/lirmm/graphik/graal/trash/* 4 | graal-examples/src/main/java/fr/lirmm/graphik/graal/test/* 5 | *.patch 6 | **/src/design/ 7 | 8 | # Compiled source # 9 | ################### 10 | *.com 11 | *.class 12 | *.dll 13 | *.exe 14 | *.o 15 | *.so 16 | *.lo 17 | *.Plo 18 | 19 | # Packages # 20 | ############ 21 | # it's better to unpack these files and commit the raw source 22 | # git has its own built in compression methods 23 | *.7z 24 | *.dmg 25 | *.gz 26 | *.iso 27 | *.jar 28 | *.rar 29 | *.tar 30 | *.zip 31 | 32 | # IDE generated directory # 33 | ########################### 34 | .classpath 35 | .metadata 36 | .project 37 | .settings 38 | .vscode 39 | target 40 | 41 | # Logs and databases # 42 | ###################### 43 | *.log 44 | *.sql 45 | *.sqlite 46 | 47 | # OS generated files # 48 | ###################### 49 | .DS_Store* 50 | ehthumbs.db 51 | Icon? 52 | Thumbs.db 53 | 54 | # TMP files # 55 | ############# 56 | *.swp 57 | *.swo 58 | *.swn 59 | *.*~ 60 | \#*\# 61 | 62 | # OTHER tools # 63 | ############### 64 | .pmd 65 | 66 | # ctags file 67 | tags 68 | build.xml 69 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | image: maven:3-jdk-8 2 | 3 | build: 4 | script: "mvn install -B" 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graphik-team/graal/3a9598fead4ee0a8a64ab9c1c919263d302e8841/LICENSE -------------------------------------------------------------------------------- /LICENSE-fr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/graphik-team/graal/3a9598fead4ee0a8a64ab9c1c919263d302e8841/LICENSE-fr -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Graal 2 | 3 | [See Graal homepage](https://graphik-team.github.io/graal) 4 | 5 | ## How to build graal? ## 6 | 7 | * install [git](http://www.git-scm.com/) 8 | * clone the repository 9 | ~~~ 10 | git clone https://github.com/graphik-team/graal.git 11 | ~~~ 12 | 13 | * build the project 14 | ~~~ 15 | mvn package 16 | ~~~ 17 | 18 | ## How to generate Javadoc? ## 19 | 20 | ~~~ 21 | mvn javadoc:javadoc 22 | mvn javadoc:aggregate 23 | ~~~ 24 | 25 | ## How to check code with code analyzer? ## 26 | 27 | ~~~ 28 | mvn pmd:check 29 | mvn findbugs:check 30 | ~~~ 31 | 32 | ## How to build graal when you don't want to get all stuff maven brings? 33 | 34 | ~~~ 35 | ./prepare_ant.sh 36 | ant 37 | ~~~ 38 | -------------------------------------------------------------------------------- /config/findbugs/exclude-filter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/dev/RELEASE-PROCESS.txt: -------------------------------------------------------------------------------- 1 | # RELEASE PROCESS 2 | ##################################################################### 3 | 4 | ## TO CHECK 5 | 6 | ~~~ 7 | mvn clean install 8 | mvn dependency:analyse 9 | mvn pmd:check 10 | mvn findbugs:check 11 | ~~~ 12 | 13 | --- 14 | ## RELEASE 15 | 16 | ~~~ 17 | mvn release:prepare 18 | git checkout graal-?.?.? 19 | mvn deploy -P release 20 | ~~~ 21 | 22 | --- 23 | ## SITE 24 | 25 | ~~~ 26 | git checkout graal-?.?.? 27 | ~~~ 28 | 29 | ### go to the subdirectory graal 30 | ~~~ 31 | cd graal 32 | ~~~ 33 | 34 | #### javadoc 35 | ~~~ 36 | mvn javadoc:javadoc javadoc:aggregate 37 | cp -r target/site/apidocs ../../graal-website-src/resources/?.?.?/javadocs 38 | ~~~ 39 | 40 | #### jar 41 | ~~~ 42 | cp $(find -name "*-?.?.?.jar") graal-website-src/resources/?.?.?/ 43 | 44 | cd graal-distro 45 | mvn compile assembly:single 46 | cp target/graal-?.?.?-jar-with-dependencies.jar ../graal-website-src/resources/?.?.?/ 47 | ~~~ 48 | 49 | #### check Links 50 | ~~~ 51 | linkchecker http://graphik-team.github.io/graal/ 52 | ~~~ 53 | 54 | --- 55 | ## EXAMPLES 56 | -------------------------------------------------------------------------------- /graal-api/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | fr.lirmm.graphik 6 | graal 7 | 1.3.2-SNAPSHOT 8 | 9 | 10 | graal-api 11 | jar 12 | fr.lirmm.graphik:graal-api 13 | 14 | This module provides all interfaces of Graal. 15 | 16 | 17 | 18 | Clément SIPIETER 19 | clement@6pi.fr 20 | INRIA 21 | 22 | 23 | 24 | 25 | 26 | fr.lirmm.graphik 27 | graal-util 28 | ${project.parent.version} 29 | 30 | 31 | org.apache.commons 32 | commons-lang3 33 | ${commons-lang3.version} 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/Constant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.api.core; 47 | 48 | 49 | /** 50 | * A constant is a symbol referring to something, is either a 51 | * simple constant or a {@link Literal}. 52 | * 53 | * @author Clément Sipieter (INRIA) {@literal } 54 | * 55 | */ 56 | public interface Constant extends Term { 57 | 58 | @Override 59 | String getLabel(); 60 | 61 | @Override 62 | Object getIdentifier(); 63 | 64 | } 65 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/ConstantGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.core; 44 | 45 | /** 46 | * 47 | * @author Clément Sipieter (INRIA) {@literal } 48 | * 49 | */ 50 | public interface ConstantGenerator extends TermGenerator { 51 | 52 | /** 53 | * Generate a fresh constant, i.e. a constant which does not already exist. 54 | * 55 | * @return a fresh Constant. 56 | */ 57 | Constant getFreshSymbol(); 58 | }; 59 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/EffectiveConjunctiveQuery.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.api.core; 2 | 3 | /** 4 | * This interface represents a query associated with a partial substitution. 5 | * 6 | * @author Olivier Rodriguez 7 | */ 8 | public interface EffectiveConjunctiveQuery extends EffectiveQuery { 9 | }; 10 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/EffectiveQuery.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.api.core; 2 | 3 | /** 4 | * This interface represents a query associated with a partial substitution. 5 | * 6 | * @author Olivier Rodriguez 7 | */ 8 | public interface EffectiveQuery { 9 | 10 | Q getQuery(); 11 | 12 | S getSubstitution(); 13 | 14 | }; 15 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/FreshVarMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2018) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.core; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public interface FreshVarMapper { 50 | 51 | Variable getImageOf(T object); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/InMemoryKnowledgeBase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.core; 44 | 45 | import fr.lirmm.graphik.graal.api.kb.KnowledgeBase; 46 | 47 | /** 48 | * @author Clément Sipieter (INRIA) {@literal } 49 | * 50 | */ 51 | public interface InMemoryKnowledgeBase extends KnowledgeBase { 52 | 53 | @Override 54 | InMemoryAtomSet getFacts(); 55 | 56 | } 57 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/QueryLabeler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.core; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public interface QueryLabeler { 50 | 51 | void setLabel(Query query); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/RuleLabeler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.core; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public interface RuleLabeler { 50 | 51 | public void setLabel(Rule r); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/TermGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2015) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.core; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public interface TermGenerator { 50 | 51 | /** 52 | * Generate a fresh term, i.e. a term which does not already exist. 53 | * 54 | * @return a fresh Term. 55 | */ 56 | Term getFreshSymbol(); 57 | } 58 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/Variable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.api.core; 47 | 48 | 49 | /** 50 | * A variable is a placeholder for an other {@link Term}. 51 | * 52 | * @author Clément Sipieter (INRIA) {@literal } 53 | * 54 | */ 55 | public interface Variable extends Term { 56 | 57 | String getLabel(); 58 | 59 | } 60 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/VariableGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.core; 44 | 45 | 46 | /** 47 | * 48 | * @author Clément Sipieter (INRIA) {@literal } 49 | * 50 | */ 51 | public interface VariableGenerator extends TermGenerator { 52 | 53 | /** 54 | * Generate a fresh variable, i.e. a variable that does not already exist. 55 | * 56 | * @return a fresh variable. 57 | */ 58 | Variable getFreshSymbol(); 59 | }; 60 | 61 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/mapper/AtomMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.core.mapper; 44 | 45 | import fr.lirmm.graphik.graal.api.core.Atom; 46 | 47 | /** 48 | * @author Clément Sipieter (INRIA) {@literal } 49 | * 50 | */ 51 | public interface AtomMapper { 52 | 53 | Atom map(Atom atom); 54 | 55 | Atom unmap(Atom atom); 56 | 57 | AtomMapper inverse(); 58 | 59 | } 60 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/mapper/PredicateMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.core.mapper; 44 | 45 | import fr.lirmm.graphik.graal.api.core.Predicate; 46 | 47 | /** 48 | * @author Clément Sipieter (INRIA) {@literal } 49 | * 50 | */ 51 | public interface PredicateMapper { 52 | 53 | Predicate map(Predicate atom); 54 | 55 | Predicate unmap(Predicate atom); 56 | 57 | PredicateMapper inverse(); 58 | 59 | } 60 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/mapper/TermMapper.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.api.core.mapper; 2 | 3 | import java.util.List; 4 | 5 | import fr.lirmm.graphik.graal.api.core.Term; 6 | 7 | /** 8 | * 9 | * @author renaud colin 10 | * @author mathieu dodard 11 | * 12 | */ 13 | public interface TermMapper { 14 | 15 | public Term map(Term term); 16 | 17 | public Term unmap(Term term); 18 | 19 | public List map(List terms); 20 | 21 | public List unmap(List terms); 22 | } -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/unifier/DependencyChecker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.core.unifier; 44 | 45 | import fr.lirmm.graphik.graal.api.core.Rule; 46 | import fr.lirmm.graphik.graal.api.core.Substitution; 47 | 48 | public interface DependencyChecker { 49 | 50 | boolean isValidDependency(Rule r1, Rule r2, Substitution s); 51 | 52 | } -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/core/unifier/UnifierChecker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.core.unifier; 44 | 45 | import fr.lirmm.graphik.graal.api.core.InMemoryAtomSet; 46 | import fr.lirmm.graphik.graal.api.core.Rule; 47 | import fr.lirmm.graphik.graal.api.core.Substitution; 48 | 49 | public interface UnifierChecker extends DependencyChecker { 50 | 51 | boolean isValidDependency(Rule rule, InMemoryAtomSet query, Substitution s); 52 | 53 | } -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/factory/PredicateFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.factory; 44 | 45 | import fr.lirmm.graphik.graal.api.core.Predicate; 46 | 47 | /** 48 | * @author Clément Sipieter (INRIA) {@literal } 49 | * 50 | */ 51 | public interface PredicateFactory { 52 | 53 | Predicate create(Object identifier, int arity); 54 | } 55 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/factory/SubstitutionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.factory; 44 | 45 | import fr.lirmm.graphik.graal.api.core.Substitution; 46 | 47 | /** 48 | * @author Clément Sipieter (INRIA) {@literal } 49 | * 50 | */ 51 | public interface SubstitutionFactory { 52 | 53 | public Substitution createSubstitution(); 54 | 55 | public Substitution createSubstitution(Substitution s); 56 | 57 | } 58 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/forward_chaining/RuleApplicationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.api.forward_chaining; 47 | 48 | /** 49 | * @author Clément Sipieter (INRIA) {@literal } 50 | * 51 | */ 52 | public class RuleApplicationException extends Exception { 53 | 54 | private static final long serialVersionUID = 5691481969125077695L; 55 | 56 | public RuleApplicationException(String message, Throwable e) { 57 | super(message, e); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/io/ConjunctiveQueryParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.api.io; 47 | 48 | import fr.lirmm.graphik.graal.api.core.ConjunctiveQuery; 49 | 50 | /** 51 | * @author Clément Sipieter (INRIA) 52 | * 53 | */ 54 | public interface ConjunctiveQueryParser extends Parser { 55 | 56 | } 57 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/io/GraalWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.api.io; 47 | 48 | import java.io.IOException; 49 | 50 | /** 51 | * @author Clément Sipieter (INRIA) {@literal } 52 | * 53 | */ 54 | public interface GraalWriter extends ConjunctiveQueryWriter, RuleWriter, 55 | AtomSetWriter, AtomWriter, NegativeConstraintWriter { 56 | 57 | public GraalWriter write(Object o) throws IOException; 58 | 59 | public GraalWriter write(Object... o) throws IOException; 60 | 61 | }; 62 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/io/ParseError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.api.io; 47 | 48 | /** 49 | * @author Clément Sipieter (INRIA) 50 | * 51 | */ 52 | public class ParseError extends Error { 53 | 54 | /** 55 | * 56 | */ 57 | private static final long serialVersionUID = 6399295619031902779L; 58 | 59 | public ParseError(String msg) { 60 | super(msg); 61 | } 62 | 63 | public ParseError(String msg, Throwable t) { 64 | super(msg,t); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/io/Parser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.api.io; 47 | 48 | import fr.lirmm.graphik.util.stream.CloseableIterator; 49 | 50 | 51 | /** 52 | * @author Clément Sipieter (INRIA) {@literal } 53 | * 54 | */ 55 | public interface Parser extends CloseableIterator { 56 | 57 | boolean hasNext() throws ParseException; 58 | 59 | T next() throws ParseException; 60 | 61 | } 62 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/io/WriterException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.api.io; 47 | 48 | import java.io.IOException; 49 | 50 | /** 51 | * @author Clément Sipieter (INRIA) 52 | * 53 | */ 54 | public class WriterException extends IOException { 55 | 56 | private static final long serialVersionUID = -1719359432056325781L; 57 | 58 | /** 59 | * @param message 60 | */ 61 | public WriterException(String message) { 62 | super(message); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/kb/Approach.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.api.kb; 44 | 45 | /** 46 | * {@link Approach} defines the priority for query answering (ie saturation or 47 | * rewriting). 48 | * 49 | * @author Clément Sipieter (INRIA) {@literal } 50 | */ 51 | public enum Approach { 52 | SATURATION_ONLY, 53 | REWRITING_ONLY, 54 | SATURATION_FIRST, 55 | REWRITING_FIRST; 56 | } 57 | -------------------------------------------------------------------------------- /graal-api/src/main/java/fr/lirmm/graphik/graal/api/store/TripleStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.api.store; 47 | 48 | 49 | 50 | /** 51 | * @author Clément Sipieter (INRIA) {@literal } 52 | * 53 | */ 54 | public interface TripleStore extends Store { 55 | 56 | } 57 | -------------------------------------------------------------------------------- /graal-backward-chaining/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-backward-chaining/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | graal-backward-chaining 12 | jar 13 | fr.lirmm.graphik:graal-backward-chaining 14 | The graal-backward-chaining provides implementation for query rewriting algorithms. 15 | 16 | 17 | 18 | Mélanie KONIG 19 | LIRMM 20 | 21 | 22 | Clément SIPIETER 23 | clement@6pi.fr 24 | INRIA 25 | 26 | 27 | 28 | 29 | 30 | fr.lirmm.graphik 31 | graal-util 32 | ${project.parent.version} 33 | 34 | 35 | fr.lirmm.graphik 36 | graal-core 37 | ${project.parent.version} 38 | 39 | 40 | fr.lirmm.graphik 41 | graal-homomorphism 42 | ${project.parent.version} 43 | 44 | 45 | org.apache.commons 46 | commons-lang3 47 | ${commons-lang3.version} 48 | 49 | 50 | fr.lirmm.graphik 51 | graal-io-dlgp 52 | ${project.parent.version} 53 | test 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /graal-builtin-predicates/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-builtin-predicates/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 4.0.0 6 | 7 | 8 | fr.lirmm.graphik 9 | graal 10 | 1.3.2-SNAPSHOT 11 | 12 | 13 | graal-builtin-predicates 14 | jar 15 | fr.lirmm.graphik:graal-builtin-predicates 16 | 17 | Allow graal to use built-in predicates in queries and rules (ex: =, >, <) 18 | 19 | 20 | 21 | 22 | Olivier RODRIGUEZ 23 | 24 | 25 | 26 | 27 | 28 | fr.lirmm.graphik 29 | graal-core 30 | ${project.parent.version} 31 | 32 | 33 | 34 | fr.lirmm.graphik 35 | graal-forward-chaining 36 | ${project.parent.version} 37 | 38 | 39 | 40 | 41 | 42 | fr.lirmm.graphik 43 | graal-io-dlgp 44 | ${project.parent.version} 45 | test 46 | 47 | 48 | 49 | fr.lirmm.graphik 50 | graal-kb 51 | ${project.parent.version} 52 | test 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /graal-builtin-predicates/src/main/java/fr/lirmm/graphik/graal/api/core/BuiltInPredicate.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.api.core; 2 | 3 | import java.util.List; 4 | 5 | import fr.lirmm.graphik.graal.api.homomorphism.HomomorphismException; 6 | 7 | /** 8 | * Represents a built-in predicate which is a predicate who can validate a data 9 | * following is own semantic. 10 | * 11 | * @author Olivier Rodriguez 12 | */ 13 | abstract public class BuiltInPredicate extends Predicate { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | public BuiltInPredicate(Object identifier, int arity) { 18 | super(identifier, arity); 19 | } 20 | 21 | abstract public boolean validate(List terms) throws HomomorphismException; 22 | } -------------------------------------------------------------------------------- /graal-builtin-predicates/src/main/java/fr/lirmm/graphik/graal/api/core/BuiltInPredicateSet.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.api.core; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Olivier Rodriguez 7 | */ 8 | public interface BuiltInPredicateSet extends List { 9 | 10 | } -------------------------------------------------------------------------------- /graal-builtin-predicates/src/main/java/fr/lirmm/graphik/graal/api/core/ConjunctiveQueryWithBuiltInPredicates.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.api.core; 2 | 3 | /** 4 | * @author Olivier Rodriguez 5 | */ 6 | public interface ConjunctiveQueryWithBuiltInPredicates extends Query { 7 | 8 | public ConjunctiveQuery getBaseQuery(); 9 | 10 | public ConjunctiveQuery getBuiltInQuery(); 11 | 12 | public void setBuiltInPredicates(BuiltInPredicateSet btpredicatesSet); 13 | 14 | public BuiltInPredicateSet getBuiltInPredicates(); 15 | } -------------------------------------------------------------------------------- /graal-builtin-predicates/src/main/java/fr/lirmm/graphik/graal/api/core/RuleWithBuiltInPredicate.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.api.core; 2 | 3 | /** 4 | * 5 | * @author Olivier Rodriguez 6 | * 7 | */ 8 | public interface RuleWithBuiltInPredicate extends Rule { 9 | 10 | public void setBuiltInPredicates(BuiltInPredicateSet btpredicates); 11 | 12 | public BuiltInPredicateSet getBuiltInPredicates(); 13 | } -------------------------------------------------------------------------------- /graal-builtin-predicates/src/main/java/fr/lirmm/graphik/graal/api/util/ClassicBuiltInPredicates.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.api.util; 2 | 3 | import java.util.List; 4 | 5 | import fr.lirmm.graphik.graal.api.core.BuiltInPredicate; 6 | import fr.lirmm.graphik.graal.api.core.Term; 7 | import fr.lirmm.graphik.graal.api.homomorphism.HomomorphismException; 8 | import fr.lirmm.graphik.util.URIUtils; 9 | 10 | /** 11 | * @author Olivier Rodriguez 12 | */ 13 | final public class ClassicBuiltInPredicates { 14 | 15 | private ClassicBuiltInPredicates() { 16 | } 17 | 18 | public static BuiltInPredicate[] defaultPredicates() { 19 | return new BuiltInPredicate[] { new PredicateNeq("bt__neq"), new PredicateEq("bt__eq") }; 20 | } 21 | 22 | public static BuiltInPredicate[] owlPredicates() { 23 | return new BuiltInPredicate[] { 24 | new PredicateNeq(URIUtils.createURI("http://www.w3.org/2002/07/owl#differentFrom")), 25 | new PredicateEq(URIUtils.createURI("http://www.w3.org/2002/07/owl#sameAs")) }; 26 | } 27 | 28 | @SuppressWarnings("serial") 29 | public static class PredicateNeq extends BuiltInPredicate { 30 | 31 | public PredicateNeq(Object label) { 32 | super(label, 2); 33 | } 34 | 35 | @Override 36 | public boolean validate(List terms) throws HomomorphismException { 37 | 38 | if (terms.size() != getArity()) 39 | return false; 40 | 41 | int i = 0; 42 | 43 | if (terms.get(i++).isVariable() || terms.get(i++).isVariable()) 44 | throw new HomomorphismException("The argument at position " + i + " from predicate " + this 45 | + " is a variable wich cannot be validated."); 46 | 47 | return !terms.get(0).equals(terms.get(1)); 48 | } 49 | } 50 | 51 | @SuppressWarnings("serial") 52 | public static class PredicateEq extends BuiltInPredicate { 53 | 54 | public PredicateEq(Object label) { 55 | super(label, 2); 56 | } 57 | 58 | @Override 59 | public boolean validate(List terms) throws HomomorphismException { 60 | 61 | if (terms.size() != getArity()) 62 | return false; 63 | 64 | int i = 0; 65 | 66 | if (terms.get(i++).isVariable() || terms.get(i++).isVariable()) 67 | throw new HomomorphismException("The argument at position " + i + " from predicate " + this 68 | + " is a variable wich cannot be validated."); 69 | 70 | return terms.get(0).equals(terms.get(1)); 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /graal-builtin-predicates/src/main/java/fr/lirmm/graphik/graal/converter/Object2RuleWithBuiltInPredicateConverter.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.converter; 2 | 3 | import fr.lirmm.graphik.graal.api.core.Atom; 4 | import fr.lirmm.graphik.graal.api.core.BuiltInPredicateSet; 5 | import fr.lirmm.graphik.graal.api.core.InMemoryAtomSet; 6 | import fr.lirmm.graphik.graal.api.core.Rule; 7 | import fr.lirmm.graphik.graal.api.core.RuleWithBuiltInPredicate; 8 | import fr.lirmm.graphik.graal.core.DefaultRuleWithBuiltInPredicates; 9 | import fr.lirmm.graphik.util.stream.CloseableIteratorWithoutException; 10 | import fr.lirmm.graphik.util.stream.converter.ConversionException; 11 | import fr.lirmm.graphik.util.stream.converter.Converter; 12 | 13 | /** 14 | * The class can detect if an input rule contains a built-in predicates, and if 15 | * so it convert it in a built-in predicate rule. 16 | * 17 | * @author Olivier Rodriguez 18 | */ 19 | public class Object2RuleWithBuiltInPredicateConverter implements Converter { 20 | BuiltInPredicateSet btpredicates; 21 | 22 | public Object2RuleWithBuiltInPredicateConverter(BuiltInPredicateSet btpredicates) { 23 | this.btpredicates = btpredicates; 24 | } 25 | 26 | @Override 27 | public Object convert(Object object) throws ConversionException { 28 | 29 | if (object instanceof Rule && !(object instanceof RuleWithBuiltInPredicate)) { 30 | boolean found = false; 31 | 32 | // We will do a speculative process on a DefaultRuleWithBuiltInPredicates object 33 | Rule newRule = new DefaultRuleWithBuiltInPredicates((Rule) object, btpredicates); 34 | InMemoryAtomSet newRuleBody = newRule.getBody(); 35 | 36 | CloseableIteratorWithoutException it = newRuleBody.iterator(); 37 | 38 | // Detect built-in predicates 39 | while (it.hasNext()) { 40 | Atom a = it.next(); 41 | int predicateIndex = btpredicates.indexOf(a.getPredicate()); 42 | 43 | // Match 44 | if (predicateIndex != -1) { 45 | found = true; 46 | a.setPredicate(btpredicates.get(predicateIndex)); 47 | } 48 | } 49 | 50 | if (found) 51 | return newRule; 52 | } 53 | return object; 54 | } 55 | } -------------------------------------------------------------------------------- /graal-builtin-predicates/src/main/java/fr/lirmm/graphik/graal/core/DefaultBuiltInPredicateSet.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.core; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | import java.util.Collection; 6 | 7 | import fr.lirmm.graphik.graal.api.core.BuiltInPredicate; 8 | import fr.lirmm.graphik.graal.api.core.BuiltInPredicateSet; 9 | 10 | /** 11 | * @author Olivier Rodriguez 12 | */ 13 | public class DefaultBuiltInPredicateSet extends ArrayList implements BuiltInPredicateSet { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | public DefaultBuiltInPredicateSet() { 18 | super(); 19 | } 20 | 21 | public DefaultBuiltInPredicateSet(Collection asList) { 22 | super(asList); 23 | } 24 | 25 | public DefaultBuiltInPredicateSet(BuiltInPredicate... asList) { 26 | super(Arrays.asList(asList)); 27 | } 28 | } -------------------------------------------------------------------------------- /graal-builtin-predicates/src/main/java/fr/lirmm/graphik/graal/homomorphism/checker/ConjunctiveQueryWithBuiltInPredicatesChecker.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.homomorphism.checker; 2 | 3 | import fr.lirmm.graphik.graal.api.core.AtomSet; 4 | import fr.lirmm.graphik.graal.api.core.ConjunctiveQueryWithBuiltInPredicates; 5 | import fr.lirmm.graphik.graal.api.core.Query; 6 | import fr.lirmm.graphik.graal.api.homomorphism.AbstractChecker; 7 | import fr.lirmm.graphik.graal.api.homomorphism.Homomorphism; 8 | import fr.lirmm.graphik.graal.api.homomorphism.HomomorphismChecker; 9 | import fr.lirmm.graphik.graal.homomorphism.ConjunctiveQueryWithBuiltInPredicatesHomomorphism; 10 | 11 | /** 12 | * @author Olivier Rodriguez 13 | */ 14 | public class ConjunctiveQueryWithBuiltInPredicatesChecker extends AbstractChecker implements HomomorphismChecker { 15 | private static final ConjunctiveQueryWithBuiltInPredicatesChecker INSTANCE = new ConjunctiveQueryWithBuiltInPredicatesChecker(); 16 | 17 | public static ConjunctiveQueryWithBuiltInPredicatesChecker instance() { 18 | return INSTANCE; 19 | } 20 | 21 | private ConjunctiveQueryWithBuiltInPredicatesChecker() { 22 | } 23 | 24 | @Override 25 | public boolean check(Object query, AtomSet atomset) { 26 | return query instanceof ConjunctiveQueryWithBuiltInPredicates; 27 | } 28 | 29 | @Override 30 | public Homomorphism getSolver() { 31 | return ConjunctiveQueryWithBuiltInPredicatesHomomorphism.instance(); 32 | } 33 | 34 | @Override 35 | public int getDefaultPriority() { 36 | return 0; 37 | } 38 | } -------------------------------------------------------------------------------- /graal-core/.gitignore: -------------------------------------------------------------------------------- 1 | .classpath 2 | .project 3 | .settings 4 | target 5 | -------------------------------------------------------------------------------- /graal-core/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | graal-core 12 | jar 13 | fr.lirmm.graphik:graal-core 14 | 15 | This module contains the main interfaces and classes of Graal. 16 | 17 | 18 | 19 | Clément SIPIETER 20 | clement@6pi.fr 21 | INRIA 22 | 23 | 24 | 25 | 26 | 27 | fr.lirmm.graphik 28 | graal-util 29 | ${project.parent.version} 30 | 31 | 32 | fr.lirmm.graphik 33 | graal-api 34 | ${project.parent.version} 35 | 36 | 37 | org.apache.commons 38 | commons-lang3 39 | ${commons-lang3.version} 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /graal-core/src/main/java/fr/lirmm/graphik/graal/GraalConstant.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal; 2 | 3 | import fr.lirmm.graphik.util.Prefix; 4 | import fr.lirmm.graphik.util.URIUtils; 5 | import fr.lirmm.graphik.graal.api.core.Predicate; 6 | import fr.lirmm.graphik.graal.api.core.Term; 7 | import fr.lirmm.graphik.graal.core.term.DefaultTermFactory; 8 | 9 | public final class GraalConstant { 10 | 11 | public static final Prefix INTERNAL_PREFIX = new Prefix("graal","http://www.lirmm.fr/graphik/graal/"); 12 | public static final Prefix FRESH_PREFIX = new Prefix("graal-fresh","http://www.lirmm.fr/graphik/graal/fresh/"); 13 | 14 | public static final Predicate freshPredicate(final int arity) { 15 | return new Predicate(URIUtils.createURI("p" + (_predicate_count++), FRESH_PREFIX), arity); 16 | } 17 | 18 | public static final Term freshConstant() { 19 | return DefaultTermFactory.instance().createConstant(URIUtils.createURI("c" + (_constant_count++), FRESH_PREFIX)); 20 | 21 | } 22 | 23 | private static int _predicate_count = 0; 24 | private static int _constant_count = 0; 25 | 26 | private GraalConstant() { } 27 | }; 28 | 29 | -------------------------------------------------------------------------------- /graal-core/src/main/java/fr/lirmm/graphik/graal/core/DefaultEffectiveConjunctiveQuery.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.core; 2 | 3 | import fr.lirmm.graphik.graal.api.core.ConjunctiveQuery; 4 | import fr.lirmm.graphik.graal.api.core.EffectiveConjunctiveQuery; 5 | import fr.lirmm.graphik.graal.api.core.Substitution; 6 | 7 | public class DefaultEffectiveConjunctiveQuery extends DefaultEffectiveQuery implements EffectiveConjunctiveQuery { 8 | 9 | public DefaultEffectiveConjunctiveQuery(ConjunctiveQuery q, Substitution s) { 10 | super(q, s); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /graal-core/src/main/java/fr/lirmm/graphik/graal/core/DefaultEffectiveQuery.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.core; 2 | 3 | import fr.lirmm.graphik.graal.api.core.EffectiveQuery; 4 | import fr.lirmm.graphik.graal.api.core.Query; 5 | import fr.lirmm.graphik.graal.api.core.Substitution; 6 | import fr.lirmm.graphik.util.string.AppendableToStringBuilder; 7 | 8 | public class DefaultEffectiveQuery implements EffectiveQuery, AppendableToStringBuilder { 9 | Q query; 10 | S substitution; 11 | 12 | public DefaultEffectiveQuery(Q q, S s) { 13 | query = q; 14 | substitution = s; 15 | } 16 | 17 | @Override 18 | public S getSubstitution() { 19 | return substitution; 20 | } 21 | 22 | @Override 23 | public Q getQuery() { 24 | return query; 25 | } 26 | 27 | // ///////////////////////////////////////////////////////////////////////// 28 | // OBJECT METHODS 29 | // ///////////////////////////////////////////////////////////////////////// 30 | 31 | @Override 32 | public String toString() { 33 | StringBuilder sb = new StringBuilder(); 34 | this.appendTo(sb); 35 | return sb.toString(); 36 | } 37 | 38 | @Override 39 | public void appendTo(StringBuilder sb) { 40 | sb.append(getClass().getSimpleName() + ": "); 41 | sb.append(getQuery()); 42 | sb.append(getSubstitution()); 43 | sb.append("\n"); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /graal-core/src/main/java/fr/lirmm/graphik/graal/core/StoredVariableGenerator.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.core; 2 | 3 | import java.util.Collection; 4 | import java.util.LinkedList; 5 | 6 | import fr.lirmm.graphik.graal.api.core.Term; 7 | import fr.lirmm.graphik.graal.api.core.Variable; 8 | 9 | /** 10 | * 11 | * @author renaud colin 12 | * @author mathieu dodard 13 | * 14 | */ 15 | public class StoredVariableGenerator extends DefaultVariableGenerator{ 16 | 17 | /** 18 | * List of all generated symbol 19 | */ 20 | private LinkedList generatedSymbols; 21 | 22 | /** 23 | * SubList of @see{generatedSymbols} 24 | * Store only generated symbol until resetGeneratedSymbol() is called 25 | */ 26 | private LinkedList newGeneratedSymbols; 27 | 28 | public StoredVariableGenerator(String prefix) { 29 | super(prefix); 30 | generatedSymbols=new LinkedList<>(); 31 | newGeneratedSymbols = new LinkedList<>(); 32 | } 33 | 34 | 35 | /** 36 | * 37 | * @return the list of generated symbol 38 | */ 39 | public Collection getGeneratedSymbol(){ 40 | return generatedSymbols; 41 | } 42 | 43 | /** 44 | * Getting the list of new generated symbol is useful 45 | * for check at each chase step, if some special processes must be done or not 46 | * @return the list of new generated symbol 47 | 48 | */ 49 | public Collection getNewGeneratedSymbol(){ 50 | return newGeneratedSymbols; 51 | } 52 | 53 | /** 54 | * Reset the list of newGeneratedSymbol 55 | */ 56 | public void resetNewGeneratedSymbol() { 57 | newGeneratedSymbols.clear(); 58 | } 59 | 60 | @Override 61 | public Variable getFreshSymbol() { 62 | Variable var = super.getFreshSymbol(); 63 | generatedSymbols.add(var); 64 | newGeneratedSymbols.add(var); 65 | return var; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /graal-core/src/main/java/fr/lirmm/graphik/graal/core/atomset/graph/Edge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.core.atomset.graph; 47 | 48 | import java.util.Set; 49 | 50 | /** 51 | * @author Clément Sipieter (INRIA) 52 | * 53 | */ 54 | interface Edge { 55 | 56 | abstract public Set getVertices(); 57 | 58 | } 59 | -------------------------------------------------------------------------------- /graal-core/src/main/java/fr/lirmm/graphik/graal/core/atomset/graph/Vertex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.core.atomset.graph; 47 | 48 | interface Vertex { 49 | 50 | boolean addNeighbor(AtomEdge a); 51 | } 52 | -------------------------------------------------------------------------------- /graal-core/src/main/java/fr/lirmm/graphik/graal/core/atomset/graph/VertexComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.core.atomset.graph; 47 | 48 | import java.util.Comparator; 49 | 50 | /** 51 | * @author Clément Sipieter (INRIA) 52 | * 53 | */ 54 | class VertexComparator implements Comparator { 55 | 56 | @Override 57 | public int compare(Vertex v1, Vertex v2) { 58 | return v1.toString().compareTo(v2.toString()); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /graal-core/src/main/java/fr/lirmm/graphik/graal/core/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * This package contains the main classes of GRAAL. 45 | */ 46 | package fr.lirmm.graphik.graal.core; -------------------------------------------------------------------------------- /graal-core/src/main/java/fr/lirmm/graphik/graal/core/store/GraphDBStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.graal.core.store; 47 | 48 | import fr.lirmm.graphik.graal.api.store.Store; 49 | 50 | /** 51 | * @author Clément Sipieter (INRIA) {@literal } 52 | * 53 | */ 54 | public abstract class GraphDBStore extends AbstractStore implements Store { 55 | 56 | } 57 | -------------------------------------------------------------------------------- /graal-core/src/main/java/fr/lirmm/graphik/graal/core/stream/ConjunctiveQuery2EffCQJavaIterator.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.core.stream; 2 | 3 | import java.util.Iterator; 4 | 5 | import fr.lirmm.graphik.graal.api.core.ConjunctiveQuery; 6 | import fr.lirmm.graphik.graal.api.core.EffectiveConjunctiveQuery; 7 | import fr.lirmm.graphik.graal.core.DefaultEffectiveConjunctiveQuery; 8 | import fr.lirmm.graphik.graal.core.Substitutions; 9 | 10 | /** 11 | * Able to iterate over an Iterator of ConjunctiveQuery just as if it was an iterator of EffectiveConjunctiveQuery. 12 | * The substitutions will be set to empty substitutions. 13 | * 14 | * @author Olivier Rodriguez 15 | */ 16 | public class ConjunctiveQuery2EffCQJavaIterator implements Iterator { 17 | private Iterator iterator; 18 | 19 | // ///////////////////////////////////////////////////////////////////////// 20 | // CONSTRUCTOR 21 | // ///////////////////////////////////////////////////////////////////////// 22 | 23 | public ConjunctiveQuery2EffCQJavaIterator(Iterator it) { 24 | this.iterator = it; 25 | } 26 | 27 | // ///////////////////////////////////////////////////////////////////////// 28 | // METHODS 29 | // ///////////////////////////////////////////////////////////////////////// 30 | 31 | @Override 32 | public boolean hasNext() { 33 | return this.iterator.hasNext(); 34 | } 35 | 36 | @Override 37 | public EffectiveConjunctiveQuery next() { 38 | return new DefaultEffectiveConjunctiveQuery(iterator.next(), Substitutions.emptySubstitution()); 39 | } 40 | 41 | @Override 42 | public void remove() { 43 | this.iterator.remove(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /graal-core/src/main/java/fr/lirmm/graphik/graal/core/stream/EffCQ2ConjunctiveQueryJavaIterator.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.core.stream; 2 | 3 | import java.util.Iterator; 4 | 5 | import fr.lirmm.graphik.graal.api.core.ConjunctiveQuery; 6 | import fr.lirmm.graphik.graal.api.core.EffectiveConjunctiveQuery; 7 | 8 | /** 9 | * @author Olivier Rodriguez 10 | */ 11 | public class EffCQ2ConjunctiveQueryJavaIterator implements Iterator { 12 | private Iterator iterator; 13 | 14 | // ///////////////////////////////////////////////////////////////////////// 15 | // CONSTRUCTOR 16 | // ///////////////////////////////////////////////////////////////////////// 17 | 18 | public EffCQ2ConjunctiveQueryJavaIterator(Iterator it) { 19 | this.iterator = it; 20 | } 21 | 22 | // ///////////////////////////////////////////////////////////////////////// 23 | // METHODS 24 | // ///////////////////////////////////////////////////////////////////////// 25 | 26 | @Override 27 | public boolean hasNext() { 28 | return this.iterator.hasNext(); 29 | } 30 | 31 | @Override 32 | public ConjunctiveQuery next() { 33 | return this.iterator.next().getQuery(); 34 | } 35 | 36 | @Override 37 | public void remove() { 38 | this.iterator.remove(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /graal-core/src/main/java/fr/lirmm/graphik/graal/core/unifier/RuleDependencyUtils.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.core.unifier; 2 | 3 | import java.util.Iterator; 4 | 5 | import fr.lirmm.graphik.graal.api.core.Rule; 6 | import fr.lirmm.graphik.graal.api.core.Substitution; 7 | import fr.lirmm.graphik.graal.api.core.unifier.DependencyChecker; 8 | 9 | /** 10 | * @author Olivier Rodriguez 11 | */ 12 | public class RuleDependencyUtils { 13 | 14 | private RuleDependencyUtils() { 15 | } 16 | 17 | /** 18 | * Validate a dependency between r1 (source) and r2 (target) with one of their unifier according to the checkers. 19 | * 20 | * @param r1 Source rule 21 | * @param r2 Target rule 22 | * @param unifierSubs One unifier to check 23 | * @param checkers The DependencyCheckers 24 | * @return True if is a valid dependency according to the checkers 25 | */ 26 | public static boolean validateUnifier(Rule r1, Rule r2, Substitution unifierSubs, DependencyChecker checkers[]) { 27 | 28 | for (DependencyChecker checker : checkers) { 29 | 30 | if (!checker.isValidDependency(r1, r2, unifierSubs)) 31 | return false; 32 | } 33 | return true; 34 | } 35 | 36 | /** 37 | * Delete the unifiers from $unifiers that doesn't validate all the checkers. 38 | * 39 | * @param r1 Source rule 40 | * @param r2 Target rule 41 | * @param unifiers The unifiers to check (clean) 42 | * @param checkers The DependencyCheckers 43 | */ 44 | public static void cleanUnifiers(Rule r1, Rule r2, Iterator unifiers, DependencyChecker checkers[]) { 45 | 46 | while (unifiers.hasNext()) { 47 | 48 | if (!validateUnifier(r1, r2, unifiers.next(), checkers)) 49 | unifiers.remove(); 50 | } 51 | } 52 | 53 | /** 54 | * @see #cleanUnifiers(Rule, Rule, Iterator, DependencyChecker[]) 55 | */ 56 | public static void cleanQueryUnifiers(Rule r1, Rule r2, Iterator unifiers, DependencyChecker checkers[]) { 57 | 58 | while (unifiers.hasNext()) { 59 | 60 | if (!RuleDependencyUtils.validateUnifier(r1, r2, unifiers.next().getAssociatedSubstitution(), checkers)) 61 | unifiers.remove(); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /graal-coverage/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-forward-chaining/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-forward-chaining/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | graal-forward-chaining 12 | jar 13 | fr.lirmm.graphik:graal-forward-chaining 14 | The graal-forward-chaining module provides implementation for chase algorithms. 15 | 16 | 17 | 18 | Clément SIPIETER 19 | clement@6pi.fr 20 | INRIA 21 | 22 | 23 | 24 | 25 | 26 | fr.lirmm.graphik 27 | graal-api 28 | ${project.parent.version} 29 | 30 | 31 | fr.lirmm.graphik 32 | graal-util 33 | ${project.parent.version} 34 | 35 | 36 | fr.lirmm.graphik 37 | graal-core 38 | ${project.parent.version} 39 | 40 | 41 | fr.lirmm.graphik 42 | graal-homomorphism 43 | ${project.parent.version} 44 | 45 | 46 | org.apache.commons 47 | commons-lang3 48 | 3.3.2 49 | 50 | 51 | 52 | fr.lirmm.graphik 53 | graal-io-dlgp 54 | ${project.parent.version} 55 | test 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /graal-grd/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-grd/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | graal-grd 12 | jar 13 | fr.lirmm.graphik:graal-grd 14 | The graal-grd module provides an implementation of the GraphOfRuleDependencies interface. 15 | 16 | 17 | 18 | Clément SIPIETER 19 | clement@6pi.fr 20 | INRIA 21 | 22 | 23 | 24 | 25 | 26 | fr.lirmm.graphik 27 | graal-api 28 | ${project.parent.version} 29 | 30 | 31 | fr.lirmm.graphik 32 | graal-util 33 | ${project.parent.version} 34 | 35 | 36 | fr.lirmm.graphik 37 | graal-core 38 | ${project.parent.version} 39 | 40 | 41 | fr.lirmm.graphik 42 | graal-homomorphism 43 | ${project.parent.version} 44 | 45 | 46 | fr.lirmm.graphik 47 | graal-forward-chaining 48 | ${project.parent.version} 49 | 50 | 51 | org.jgrapht 52 | jgrapht-core 53 | ${jgrapht.version} 54 | 55 | 56 | org.apache.commons 57 | commons-lang3 58 | ${commons-lang3.version} 59 | 60 | 61 | 62 | fr.lirmm.graphik 63 | graal-io-dlgp 64 | ${project.parent.version} 65 | test 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /graal-homomorphism/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-homomorphism/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | fr.lirmm.graphik 6 | graal 7 | 1.3.2-SNAPSHOT 8 | 9 | 10 | graal-homomorphism 11 | fr.lirmm.graphik:graal-homomorphism 12 | jar 13 | The Homomorphism module implements algorithms to query data. 14 | 15 | 16 | 17 | Clément SIPIETER 18 | clement@6pi.fr 19 | INRIA 20 | 21 | 22 | 23 | 24 | 25 | fr.lirmm.graphik 26 | graal-api 27 | ${project.parent.version} 28 | 29 | 30 | fr.lirmm.graphik 31 | graal-core 32 | ${project.parent.version} 33 | 34 | 35 | org.apache.commons 36 | commons-lang3 37 | 3.4 38 | 39 | 40 | org.apache.commons 41 | commons-collections4 42 | 4.1 43 | 44 | 45 | 46 | 47 | fr.lirmm.graphik 48 | graal-io-dlgp 49 | ${project.parent.version} 50 | test 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /graal-homomorphism/src/main/java/fr/lirmm/graphik/graal/homomorphism/scheduler/AbstractScheduler.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.homomorphism.scheduler; 2 | 3 | import fr.lirmm.graphik.graal.api.core.InMemoryAtomSet; 4 | import fr.lirmm.graphik.graal.api.core.Substitution; 5 | import fr.lirmm.graphik.graal.api.core.Variable; 6 | import fr.lirmm.graphik.graal.core.factory.DefaultSubstitutionFactory; 7 | import fr.lirmm.graphik.graal.core.term.DefaultTermFactory; 8 | import fr.lirmm.graphik.util.profiler.AbstractProfilable; 9 | 10 | public abstract class AbstractScheduler extends AbstractProfilable implements Scheduler { 11 | 12 | 13 | protected static InMemoryAtomSet computeFixedQuery(InMemoryAtomSet atomset, Iterable fixedTerms) { 14 | // create a Substitution for fixed query 15 | Substitution fixSub = DefaultSubstitutionFactory.instance().createSubstitution(); 16 | for (Variable t : fixedTerms) { 17 | fixSub.put(t, DefaultTermFactory.instance().createConstant(t.getLabel())); 18 | } 19 | 20 | return fixSub.createImageOf(atomset); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /graal-io/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-io/graal-io-dlgp/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-io/graal-io-dlgp/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal-io 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | graal-io-dlgp 12 | jar 13 | fr.lirmm.graphik:graal-io-dlgp 14 | The graal-io-dlgp provides a parser and a writer for the Dlgp format. 15 | 16 | 17 | 18 | Clément SIPIETER 19 | clement@6pi.fr 20 | INRIA 21 | 22 | 23 | 24 | 25 | 26 | fr.lirmm.graphik 27 | graal-util 28 | ${project.parent.version} 29 | 30 | 31 | fr.lirmm.graphik 32 | graal-core 33 | ${project.parent.version} 34 | 35 | 36 | fr.lirmm.graphik 37 | graal-api 38 | ${project.parent.version} 39 | 40 | 41 | org.apache.commons 42 | commons-lang3 43 | ${commons-lang3.version} 44 | 45 | 46 | fr.lirmm.graphik 47 | dlgp2-parser 48 | 2.1.1 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /graal-io/graal-io-dlgp/src/test/resources/correct.dlp: -------------------------------------------------------------------------------- 1 | [f1] p(a), relatedTo(a,b), q(b). [f2] p(X), t(X,a,b), s(a,z). 2 | [c1] !:-relatedTo(X 3 | % this is a comment 4 | ,X). 5 | [q1]?(X) :- p(X), relatedTo(X,Z), t(a,Z). 6 | t(X,a,b). 7 | [r1] relatedTo(X,Y) :- p(X), t(X,Z). 8 | [constraint_2] ! :- X=Y, t(X,Y,b). 9 | s(X,Y), s(Y,Z) :- % This is another comment 10 | q(X),t(X,Z). 11 | [rA_1] p(X) 12 | :- 13 | q(X) 14 | . Y=Z :- t(X,Y),t(X,Z). 15 | [Query2] 16 | ? (X,Y) :- relatedTo(X,X), Y=a. 17 | s(Z) :- a=b, X=Y, X=a, p(X,Y). 18 | !:- p(X), q(X). 19 | relatedTo(Y,z).? :- p(X). 20 | -------------------------------------------------------------------------------- /graal-io/graal-io-dlgp/src/test/resources/irisAndLiterals.dlp: -------------------------------------------------------------------------------- 1 | @base 2 | @prefix ex: 3 | @prefix inria-team: 4 | @prefix xsd: 5 | 6 | @facts 7 | 8 | % use of @base 9 | [f 1] (1.5). 10 | 11 | % use of @prefix 12 | [f 2] ex:Pred("1.5"^^xsd:decimal). 13 | 14 | % absolute IRIs 15 | [f 3] 16 | ("1.5"^^). 17 | 18 | % use of @base for the predicate and @prefix for the argument 19 | [f 4] team(inria-team:graphik). 20 | -------------------------------------------------------------------------------- /graal-io/graal-io-dlgp/src/test/resources/simple.dlp: -------------------------------------------------------------------------------- 1 | @facts 2 | [f1] p(a), relatedTo(a,b), q(b). 3 | [f2] p(X), t(X,a,b), s(a,z). 4 | t(X,a,b), relatedTo(Y,z). 5 | 6 | @constraints 7 | [c1] ! :- relatedTo(X,X). 8 | [constraint_2] ! :- X=Y, t(X,Y,b). 9 | ! :- p(X), q(X). 10 | 11 | @rules 12 | [r1] relatedTo(X,Y) :- p(X), t(X,Z). 13 | s(X,Y), s(Y,Z) :- q(X),t(X,Z). 14 | [rA 1] p(X) :- q(X). 15 | Y=Z :- t(X,Y),t(X,Z). 16 | s(a) :- . 17 | s(Z) :- a=b, X=Y, X=a, p(X,Y). 18 | 19 | @queries 20 | [q1] ? (X) :- p(X), relatedTo(X,Z), t(a,Z). 21 | [Query2] ? (X,Y) :- relatedTo(X,X), Y=a. 22 | ? :- p(X). 23 | ?() :- . 24 | -------------------------------------------------------------------------------- /graal-io/graal-io-owl/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-io/graal-io-owl/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal-io 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | graal-io-owl 12 | jar 13 | fr.lirmm.graphik:graal-io-owl 14 | The graal-io-owl module provides a parser from OWL2. 15 | 16 | 2015 17 | 18 | 19 | 20 | Clément SIPIETER 21 | clement@6pi.fr 22 | INRIA 23 | 24 | 25 | 26 | 27 | 28 | fr.lirmm.graphik 29 | graal-util 30 | ${project.parent.version} 31 | 32 | 33 | fr.lirmm.graphik 34 | graal-core 35 | ${project.parent.version} 36 | 37 | 38 | fr.lirmm.graphik 39 | graal-api 40 | ${project.parent.version} 41 | 42 | 43 | net.sourceforge.owlapi 44 | owlapi-apibinding 45 | 4.0.1 46 | 47 | 48 | org.apache.commons 49 | commons-lang3 50 | 3.3.2 51 | 52 | 53 | org.apache.commons 54 | commons-collections4 55 | 4.1 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /graal-io/graal-io-rdf/config: -------------------------------------------------------------------------------- 1 | ../config/ -------------------------------------------------------------------------------- /graal-io/graal-io-rdf/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal-io 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | graal-io-rdf 12 | jar 13 | fr.lirmm.graphik:graal-io-rdf 14 | 15 | 16 | 17 | Clément SIPIETER 18 | clement@6pi.fr 19 | INRIA 20 | 21 | 22 | 23 | 24 | 1.0.3 25 | 26 | 27 | 28 | 29 | fr.lirmm.graphik 30 | graal-util 31 | ${project.parent.version} 32 | 33 | 34 | fr.lirmm.graphik 35 | graal-core 36 | ${project.parent.version} 37 | 38 | 39 | fr.lirmm.graphik 40 | rdf4j-common 41 | ${project.parent.version} 42 | 43 | 44 | org.eclipse.rdf4j 45 | rdf4j-model 46 | ${rdf4j.version} 47 | 48 | 49 | org.eclipse.rdf4j 50 | rdf4j-rio-api 51 | ${rdf4j.version} 52 | 53 | 54 | org.eclipse.rdf4j 55 | rdf4j-rio-rdfxml 56 | ${rdf4j.version} 57 | 58 | 59 | org.eclipse.rdf4j 60 | rdf4j-rio-turtle 61 | ${rdf4j.version} 62 | 63 | 64 | org.slf4j 65 | slf4j-api 66 | 1.7.7 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /graal-io/graal-io-ruleml/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-io/graal-io-ruleml/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal-io 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | graal-io-ruleml 12 | jar 13 | fr.lirmm.graphik:graal-io-ruleml 14 | 15 | 16 | UTF-8 17 | 18 | 19 | 2014 20 | 21 | 22 | INRIA 23 | http://www.inria.fr/ 24 | 25 | 26 | 27 | 28 | Clément SIPIETER 29 | clement@6pi.fr 30 | INRIA 31 | 32 | 33 | 34 | 35 | 36 | fr.lirmm.graphik 37 | graal-util 38 | ${project.parent.version} 39 | 40 | 41 | fr.lirmm.graphik 42 | graal-core 43 | ${project.parent.version} 44 | 45 | 46 | fr.lirmm.graphik 47 | graal-api 48 | ${project.parent.version} 49 | 50 | 51 | 52 | 53 | 54 | 55 | org.apache.maven.plugins 56 | maven-compiler-plugin 57 | 3.1 58 | 59 | ${jdk.version} 60 | ${jdk.version} 61 | 62 | 63 | 64 | maven-release-plugin 65 | 2.1 66 | 67 | clean install 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /graal-io/graal-io-sparql/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-io/graal-io-sparql/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal-io 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | graal-io-sparql 12 | jar 13 | fr.lirmm.graphik:graal-io-sparql 14 | The graal-io-sparql provides a parser and a writer for sparql queries (core). 15 | 16 | 2015 17 | 18 | 19 | 20 | Clément SIPIETER 21 | clement@6pi.fr 22 | INRIA 23 | 24 | 25 | 26 | 27 | 28 | fr.lirmm.graphik 29 | graal-util 30 | ${project.parent.version} 31 | 32 | 33 | fr.lirmm.graphik 34 | graal-core 35 | ${project.parent.version} 36 | 37 | 38 | fr.lirmm.graphik 39 | graal-api 40 | ${project.parent.version} 41 | 42 | 43 | org.apache.jena 44 | jena-core 45 | 2.13.0 46 | 47 | 48 | log4j 49 | log4j 50 | 51 | 52 | org.slf4j 53 | slf4j-log4j12 54 | 55 | 56 | 57 | 58 | org.apache.jena 59 | jena-arq 60 | 2.13.0 61 | 62 | 63 | log4j 64 | log4j 65 | 66 | 67 | org.slf4j 68 | slf4j-log4j12 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /graal-io/graal-io-sparql/src/test/java/fr/lirmm/graphik/graal/io/sparql/AbstractSparqlWriterTest.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.io.sparql; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import java.io.IOException; 6 | import java.io.StringWriter; 7 | 8 | import org.junit.Test; 9 | 10 | import fr.lirmm.graphik.graal.GraalConstant; 11 | import fr.lirmm.graphik.graal.core.term.DefaultTermFactory; 12 | import fr.lirmm.graphik.util.URIUtils; 13 | import fr.lirmm.graphik.util.URIzer; 14 | 15 | public class AbstractSparqlWriterTest { 16 | 17 | public static final AbstractSparqlWriter createSparqlWriter(java.io.Writer w) { 18 | AbstractSparqlWriter writer = new AbstractSparqlWriter(w, new URIzer(GraalConstant.INTERNAL_PREFIX)) { 19 | 20 | }; 21 | return writer; 22 | } 23 | 24 | 25 | @Test 26 | public void testWriteLiteral1() throws IOException { 27 | StringWriter sw = new StringWriter(); 28 | AbstractSparqlWriter w = createSparqlWriter(sw); 29 | 30 | w.write(DefaultTermFactory.instance().createLiteral(URIUtils.XSD_INTEGER, 1)); 31 | assertEquals("1",sw.toString()); 32 | } 33 | 34 | @Test 35 | public void testWriteLiteral2() throws IOException { 36 | StringWriter sw = new StringWriter(); 37 | AbstractSparqlWriter w = createSparqlWriter(sw); 38 | String str = "hello world!"; 39 | w.write(DefaultTermFactory.instance().createLiteral(URIUtils.XSD_STRING, str)); 40 | assertEquals("\"" + str + "\"",sw.toString()); 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /graal-io/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | fr.lirmm.graphik 6 | graal 7 | 1.3.2-SNAPSHOT 8 | 9 | 10 | graal-io 11 | fr.lirmm.graphik:graal-io 12 | pom 13 | 14 | 15 | graal-io-dlgp 16 | graal-io-owl 17 | graal-io-rdf 18 | graal-io-ruleml 19 | graal-io-sparql 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /graal-kb/config: -------------------------------------------------------------------------------- 1 | ../config/ -------------------------------------------------------------------------------- /graal-kb/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | graal-kb 12 | jar 13 | fr.lirmm.graphik:graal-kb 14 | 15 | The Graal Knowledge Base layer 16 | 17 | 18 | 19 | Clément SIPIETER 20 | clement@6pi.fr 21 | INRIA 22 | 23 | 24 | 25 | 26 | 27 | fr.lirmm.graphik 28 | graal-util 29 | ${project.parent.version} 30 | 31 | 32 | fr.lirmm.graphik 33 | graal-api 34 | ${project.parent.version} 35 | 36 | 37 | fr.lirmm.graphik 38 | graal-forward-chaining 39 | ${project.parent.version} 40 | 41 | 42 | fr.lirmm.graphik 43 | graal-backward-chaining 44 | ${project.parent.version} 45 | 46 | 47 | fr.lirmm.graphik 48 | graal-homomorphism 49 | ${project.parent.version} 50 | 51 | 52 | fr.lirmm.graphik 53 | graal-rules-analyser 54 | ${project.parent.version} 55 | 56 | 57 | 58 | fr.lirmm.graphik 59 | graal-io-dlgp 60 | ${project.parent.version} 61 | test 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /graal-keyvalue/graal-key-value-core/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | graal-keyvalue-core 7 | jar 8 | fr.lirmm.graphik:graal-keyvalue-core 9 | 10 | 11 | fr.lirmm.graphik 12 | graal-keyvalue 13 | 1.3.2-SNAPSHOT 14 | 15 | 16 | 17 | 18 | Olivier RODRIGUEZ 19 | olivier.rodriguez@inria.fr 20 | INRIA 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /graal-keyvalue/graal-key-value-core/src/test/resources/ontologies/persons.dlp: -------------------------------------------------------------------------------- 1 | @rules 2 | (Y) :- (X). 3 | (X) :- (X). 4 | 5 | @facts 6 | <0.human>(alice). 7 | <0.human.hasCorporation>(X), <0.test>(X). -------------------------------------------------------------------------------- /graal-keyvalue/graal-key-value-core/src/test/resources/ontologies/persons_result.dlp: -------------------------------------------------------------------------------- 1 | @prefix owl: 2 | 3 | @facts 4 | 5 | <0.human>(alice). 6 | <0.human.name>(X). 7 | <0.human.boss>(X), <0.human.hasCorporation>(X), <0.test>(X). -------------------------------------------------------------------------------- /graal-keyvalue/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | graal-keyvalue 7 | pom 8 | fr.lirmm.graphik:graal-keyvalue 9 | 10 | 11 | fr.lirmm.graphik 12 | graal 13 | 1.3.2-SNAPSHOT 14 | 15 | 16 | 17 | 18 | Olivier RODRIGUEZ 19 | olivier.rodriguez@inria.fr 20 | INRIA 21 | 22 | 23 | 24 | 25 | graal-key-value-core 26 | 27 | 28 | 29 | 30 | 31 | fr.lirmm.graphik 32 | graal-api 33 | ${project.version} 34 | 35 | 36 | 37 | fr.lirmm.graphik 38 | graal-core 39 | ${project.version} 40 | 41 | 42 | 43 | fr.lirmm.graphik 44 | graal-util 45 | ${project.version} 46 | 47 | 48 | 49 | org.apache.commons 50 | commons-lang3 51 | 3.8.1 52 | 53 | 54 | 55 | 56 | 57 | fr.lirmm.graphik 58 | graal-io-dlgp 59 | ${project.parent.version} 60 | test 61 | 62 | 63 | 64 | fr.lirmm.graphik 65 | graal-kb 66 | ${project.parent.version} 67 | test 68 | 69 | 70 | 71 | commons-io 72 | commons-io 73 | 2.6 74 | test 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /graal-rules-analyser/TODO: -------------------------------------------------------------------------------- 1 | Rule Analyser TODO List 2 | ======================= 3 | 4 | * And we still need to implement a servlet (and get rid of the old 5 | kiabora) 6 | 7 | -------------------------------------------------------------------------------- /graal-rules-analyser/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-rules-analyser/src/test/java/fr/lirmm/graphik/graal/rulesetanalyser/AnalyserRuleSetTest.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.rulesetanalyser; 2 | 3 | import java.util.Set; 4 | 5 | import org.junit.Test; 6 | 7 | import fr.lirmm.graphik.graal.api.core.Rule; 8 | import fr.lirmm.graphik.graal.api.core.RuleSetException; 9 | import fr.lirmm.graphik.graal.api.io.ParseException; 10 | import fr.lirmm.graphik.graal.core.grd.DefaultGraphOfRuleDependencies; 11 | import fr.lirmm.graphik.graal.io.dlp.DlgpParser; 12 | import fr.lirmm.graphik.graal.rulesetanalyser.util.AnalyserRuleSet; 13 | import fr.lirmm.graphik.util.stream.ArrayCloseableIterator; 14 | import org.junit.Assert; 15 | 16 | 17 | public class AnalyserRuleSetTest { 18 | 19 | @Test 20 | public void getGRD() throws RuleSetException, ParseException { 21 | // assume 22 | Rule r1 = DlgpParser.parseRule("q(X) :- p(X)."); 23 | Rule r2 = DlgpParser.parseRule("r(X) :- q(X)."); 24 | AnalyserRuleSet analyserRuleSet = new AnalyserRuleSet(new ArrayCloseableIterator(r1, r2)); 25 | System.out.println(analyserRuleSet); 26 | 27 | // when 28 | DefaultGraphOfRuleDependencies grd = analyserRuleSet.getGraphOfRuleDependencies(); 29 | System.out.println(grd); 30 | // then 31 | Set triggeredRules = grd.getTriggeredRules(r1); 32 | Assert.assertEquals(1, triggeredRules.size()); 33 | Assert.assertTrue(triggeredRules.contains(r2)); 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /graal-rules-analyser/src/test/resources/test.grd: -------------------------------------------------------------------------------- 1 | [R1] r(X_1, Z_1) :- q(X_1, Y_1). 2 | [R2] q(X_2, Z_2) :- r(X_2, Y_2). 3 | [R3] q(X_0, Y_0) :- p(X_0). 4 | 5 | R3 --> R1 {X_1->X_0, Y_1->Y_0} 6 | R1 --> R2 {X_2->X_1, Y_2->Z_1} 7 | R2 --> R1 {X_1->X_2, Y_1->Z_2} 8 | 9 | -------------------------------------------------------------------------------- /graal-sparql-homomorphism/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-sparql-homomorphism/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | 7 | fr.lirmm.graphik 8 | graal 9 | 1.3.2-SNAPSHOT 10 | 11 | 12 | graal-sparql-homomorphism 13 | fr.lirmm.graphik:graal-rules-analyser 14 | jar 15 | This module is dedicated to the analysis of a set of existential rules. 16 | It can check if this set belongs to a known decidable class of rules, 17 | either directly or by means of its Graph of Rule Dependencies (GRD). 18 | This module allows to analyze the properties of the strongly connected components in the GRD, 19 | which allows to determine properties of the rule set with respect to decidability 20 | as well as the kind of paradigm (forward or backward chaining) ensuring decidability. 21 | 22 | 23 | 24 | 25 | fr.lirmm.graphik 26 | graal-homomorphism 27 | ${project.parent.version} 28 | 29 | 30 | fr.lirmm.graphik 31 | graal-store-rdf4j 32 | ${project.parent.version} 33 | 34 | 35 | 36 | 37 | 38 | fr.lirmm.graphik 39 | graal-io-dlgp 40 | ${project.parent.version} 41 | test 42 | 43 | 44 | fr.lirmm.graphik 45 | graal-kb 46 | ${project.parent.version} 47 | test 48 | 49 | 50 | commons-io 51 | commons-io 52 | 2.6 53 | test 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /graal-sparql-homomorphism/src/test/resources/ontologies/noprefix.dlp: -------------------------------------------------------------------------------- 1 | @facts 2 | 3 | isa(a,aclass). 4 | 5 | @rules 6 | 7 | isa(X,aaclass) :- isa(X,aclass). -------------------------------------------------------------------------------- /graal-sparql-homomorphism/src/test/resources/ontologies/noprefix_result.dlp: -------------------------------------------------------------------------------- 1 | isa(a,aclass). 2 | isa(a,aaclass). -------------------------------------------------------------------------------- /graal-sparql-homomorphism/src/test/resources/ontologies/persons.dlp: -------------------------------------------------------------------------------- 1 | @prefix ex: 2 | 3 | @facts 4 | 5 | ex:is_a(caesar,ex:person). 6 | 7 | @rules 8 | 9 | ex:is_a(X,ex:human) :- ex:is_a(X,ex:person). -------------------------------------------------------------------------------- /graal-sparql-homomorphism/src/test/resources/ontologies/persons_result.dlp: -------------------------------------------------------------------------------- 1 | @prefix ex: 2 | 3 | @facts 4 | 5 | ex:is_a(caesar,ex:person). 6 | ex:is_a(caesar,ex:human). -------------------------------------------------------------------------------- /graal-store/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-store/graal-store-dictionary/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 4.0.0 7 | 8 | fr.lirmm.graphik 9 | graal-store 10 | 1.3.2-SNAPSHOT 11 | 12 | graal-store-dictionary 13 | fr.lirmm.graphik:graal-store-dictionary 14 | http://maven.apache.org 15 | 16 | 17 | 18 | fr.lirmm.graphik 19 | graal-core 20 | ${project.parent.version} 21 | 22 | 23 | fr.lirmm.graphik 24 | rdbms-adhoc 25 | ${project.parent.version} 26 | 27 | 28 | org.apache.commons 29 | commons-collections4 30 | 4.2 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /graal-store/graal-store-dictionary/src/main/java/org/graal/store/dictionary/DictionaryMapping.java: -------------------------------------------------------------------------------- 1 | package org.graal.store.dictionary; 2 | 3 | 4 | import fr.lirmm.graphik.graal.api.core.Predicate; 5 | import fr.lirmm.graphik.graal.api.core.Term; 6 | 7 | /** 8 | * Dictionary mapping interface 9 | * @author renaud colin 10 | * @author mathieu dodard 11 | * 12 | */ 13 | public interface DictionaryMapping { 14 | 15 | 16 | /** 17 | * @param termURI 18 | * @return the integer id associated to a termURI 19 | */ 20 | Integer getIntegerIdOf(String termURI); 21 | 22 | /** 23 | * 24 | * @param termId 25 | * @return the termURI associated to integer id 26 | */ 27 | public String getStringIdOf(int termId); 28 | 29 | 30 | /** 31 | * 32 | * @param predicate 33 | * @return the integer id associated to predicate 34 | * @throws DictionnaryMappingException if no integer id is associated to predicate 35 | */ 36 | public Integer getPredicateId(Predicate predicate) throws DictionnaryMappingException; 37 | 38 | /** 39 | * 40 | * @param term 41 | * @return the integer id associated to term 42 | * @throws DictionnaryMappingException if no integer id is associated to term 43 | */ 44 | public Integer getTermId(Term term) throws DictionnaryMappingException ; 45 | 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /graal-store/graal-store-dictionary/src/main/java/org/graal/store/dictionary/DictionnaryMappingException.java: -------------------------------------------------------------------------------- 1 | package org.graal.store.dictionary; 2 | 3 | import fr.lirmm.graphik.graal.api.core.AtomSetException; 4 | 5 | public class DictionnaryMappingException extends AtomSetException{ 6 | 7 | /** 8 | * 9 | */ 10 | private static final long serialVersionUID = -2574053279340316568L; 11 | 12 | public DictionnaryMappingException(String msg) { 13 | super(msg); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /graal-store/graal-store-dictionary/src/main/java/org/graal/store/dictionary/MapperSubstitutionConverter.java: -------------------------------------------------------------------------------- 1 | package org.graal.store.dictionary; 2 | 3 | import fr.lirmm.graphik.graal.api.core.Substitution; 4 | import fr.lirmm.graphik.util.stream.converter.ConversionException; 5 | import fr.lirmm.graphik.util.stream.converter.Converter; 6 | 7 | /** 8 | * Convert a substitution with a mapper 9 | * 10 | * @author renaud colin 11 | * @author mathieu dodard 12 | * 13 | */ 14 | public class MapperSubstitutionConverter implements Converter { 15 | 16 | private DictionaryMapper mapper; 17 | 18 | public MapperSubstitutionConverter(DictionaryMapper mapper) { 19 | super(); 20 | this.mapper = mapper; 21 | } 22 | 23 | @Override 24 | public Substitution convert(Substitution object) throws ConversionException { 25 | return mapper.unmap(object); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /graal-store/graal-store-dictionary/src/main/java/org/graal/store/dictionary/TrieDictionaryMapper.java: -------------------------------------------------------------------------------- 1 | package org.graal.store.dictionary; 2 | 3 | 4 | 5 | import java.util.Map; 6 | 7 | import org.apache.commons.collections4.MapIterator; 8 | import org.apache.commons.collections4.trie.PatriciaTrie; 9 | 10 | /** 11 | * DictionnaryMapper implementend with {@link PatriciaTrie} 12 | * @author renaud colin 13 | * @author mathieu dodard 14 | * 15 | */ 16 | public class TrieDictionaryMapper extends DictionaryMapper{ 17 | 18 | /** 19 | * termIds index implemented as patriciaTrie 20 | */ 21 | private PatriciaTrie termIds; 22 | 23 | public TrieDictionaryMapper() { 24 | super(); 25 | termIds = new PatriciaTrie<>(); 26 | } 27 | 28 | @Override 29 | public Integer getIntegerIdOf(String termURI) { 30 | return termIds.get(termURI); 31 | } 32 | 33 | @Override 34 | public void buildDictionary() { 35 | int objIdx = 0; 36 | for(int i=0 ; i < identifiers.size() ; i++) { 37 | termIds.put(identifiers.get(i), dataTypes.get(i)); 38 | } 39 | 40 | identifiers.clear(); 41 | dataTypes.clear(); 42 | 43 | MapIterator it = termIds.mapIterator(); 44 | while(it.hasNext()) { 45 | String key = it.next(); 46 | Integer value = it.getValue(); 47 | identifiers.add(key); 48 | dataTypes.add(value); 49 | it.setValue(objIdx++); 50 | } 51 | existentialBeginIdx = termIds.size(); 52 | } 53 | 54 | 55 | 56 | @Override 57 | public Map getIdentifierDictionary() { 58 | return termIds; 59 | } 60 | 61 | 62 | } 63 | 64 | -------------------------------------------------------------------------------- /graal-store/graal-store-dictionary/src/test/resources/animals.dlp: -------------------------------------------------------------------------------- 1 | % This example is based on a simplified vertebrate phylogenetic nomenclature 2 | 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4 | % Concept Hierarchy 5 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6 | 7 | animal(X) :- vertebrate(X). 8 | 9 | vertebrate(X) :- osteichthyen(X). 10 | vertebrate(X) :- chondrichthyen(X). 11 | 12 | osteichthyen(X) :- mammal(X). 13 | osteichthyen(X) :- bird(X). 14 | osteichthyen(X) :- crocodylinae(X). 15 | osteichthyen(X) :- chelydridae(X). 16 | osteichthyen(X) :- squamata(X). 17 | osteichthyen(X) :- lissamphibia(X). 18 | osteichthyen(X) :- actinopterygii(X). 19 | 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | % Rules 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | vertebrate(X) :- animal(X), has_part(X,Y), skeleton(Y). 25 | 26 | osteichthyen(X) :- animal(X), has_part(X, bone_skeleton). 27 | chondrichthyen(X) :- animal(X), has_part(X, cartilage_skeleton). 28 | 29 | mammal(X) :- vertebrate(X), has_part(X, hair). 30 | mammal(X) :- vertebrate(X), has_part(X, mammals). 31 | 32 | has_predator(X,cat) :- bird(X). 33 | 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35 | % Facts 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | 38 | skeleton(bone_skeleton), 39 | skeleton(cartilage_skeleton). 40 | 41 | animal(mouse). 42 | has_part(mouse, hair). 43 | has_part(mouse, bone_skeleton). 44 | 45 | osteichthyen(cat). 46 | has_part(cat, mammals). 47 | 48 | has_predator(mouse, cat). 49 | 50 | bird(robin). 51 | -------------------------------------------------------------------------------- /graal-store/graal-store-neo4j/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-store/graal-store-neo4j/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal-store 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | graal-store-neo4j 12 | jar 13 | fr.lirmm.graphik:graal-store-neo4j 14 | 15 | 16 | 17 | Clément SIPIETER 18 | clement@6pi.fr 19 | INRIA 20 | 21 | 22 | 23 | 24 | 25 | fr.lirmm.graphik 26 | graal-core 27 | ${project.parent.version} 28 | 29 | 30 | fr.lirmm.graphik 31 | graal-api 32 | ${project.parent.version} 33 | 34 | 35 | org.neo4j 36 | neo4j-kernel 37 | 2.3.11 38 | 39 | 40 | org.neo4j 41 | neo4j-cypher 42 | 2.3.11 43 | 44 | 45 | 46 | 47 | 48 | 49 | org.apache.maven.plugins 50 | maven-compiler-plugin 51 | 3.1 52 | 53 | ${jdk.version} 54 | ${jdk.version} 55 | 56 | 57 | 58 | maven-release-plugin 59 | 2.1 60 | 61 | clean install 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /graal-store/graal-store-rdbms/config: -------------------------------------------------------------------------------- 1 | ../config/ -------------------------------------------------------------------------------- /graal-store/graal-store-rdbms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | fr.lirmm.graphik 6 | graal-store 7 | 1.3.2-SNAPSHOT 8 | 9 | 10 | graal-store-rdbms 11 | fr.lirmm.graphik:graal-store-rdbms 12 | pom 13 | 14 | 15 | 16 | Clément SIPIETER 17 | clement@6pi.fr 18 | INRIA 19 | 20 | 21 | 22 | 23 | rdbms-common 24 | rdbms-adhoc 25 | rdbms-natural 26 | rdbms-test 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /graal-store/graal-store-rdbms/rdbms-adhoc/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-store/graal-store-rdbms/rdbms-adhoc/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal-store-rdbms 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | rdbms-adhoc 12 | jar 13 | fr.lirmm.graphik:rdbms-adhoc 14 | 15 | 16 | 17 | Clément SIPIETER 18 | clement@6pi.fr 19 | INRIA 20 | 21 | 22 | 23 | 24 | 25 | fr.lirmm.graphik 26 | rdbms-common 27 | ${project.parent.version} 28 | 29 | 30 | fr.lirmm.graphik 31 | graal-api 32 | ${project.parent.version} 33 | 34 | 35 | fr.lirmm.graphik 36 | graal-util 37 | ${project.parent.version} 38 | 39 | 40 | fr.lirmm.graphik 41 | graal-core 42 | ${project.parent.version} 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /graal-store/graal-store-rdbms/rdbms-common/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-store/graal-store-rdbms/rdbms-natural/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-store/graal-store-rdbms/rdbms-natural/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal-store-rdbms 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | rdbms-natural 12 | jar 13 | fr.lirmm.graphik:rdbms-natural 14 | 15 | 16 | 17 | Clément SIPIETER 18 | clement@6pi.fr 19 | INRIA 20 | 21 | 22 | 23 | 24 | 25 | fr.lirmm.graphik 26 | rdbms-common 27 | ${project.parent.version} 28 | 29 | 30 | fr.lirmm.graphik 31 | graal-api 32 | ${project.parent.version} 33 | 34 | 35 | fr.lirmm.graphik 36 | graal-util 37 | ${project.parent.version} 38 | 39 | 40 | fr.lirmm.graphik 41 | graal-core 42 | ${project.parent.version} 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /graal-store/graal-store-rdbms/rdbms-test/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-store/graal-store-rdbms/rdbms-test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | fr.lirmm.graphik 7 | graal-store-rdbms 8 | 1.3.2-SNAPSHOT 9 | 10 | 11 | rdbms-test 12 | jar 13 | fr.lirmm.graphik:rdbms-test 14 | 15 | 16 | 17 | Clément SIPIETER 18 | clement@6pi.fr 19 | INRIA 20 | 21 | 22 | 23 | 24 | 25 | fr.lirmm.graphik 26 | rdbms-common 27 | ${project.parent.version} 28 | test 29 | 30 | 31 | fr.lirmm.graphik 32 | rdbms-adhoc 33 | ${project.parent.version} 34 | test 35 | 36 | 37 | fr.lirmm.graphik 38 | rdbms-natural 39 | ${project.parent.version} 40 | test 41 | 42 | 43 | fr.lirmm.graphik 44 | graal-io-dlgp 45 | ${project.parent.version} 46 | test 47 | 48 | 49 | 50 | org.hsqldb 51 | hsqldb 52 | 2.3.4 53 | test 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /graal-store/graal-store-rdf4j/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-store/graal-store-rdf4j/src/main/java/fr/lirmm/graphik/graal/store/triplestore/rdf4j/TupleQueryResult2SubstitutionConverter.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.graal.store.triplestore.rdf4j; 2 | 3 | import java.util.List; 4 | 5 | import org.eclipse.rdf4j.query.BindingSet; 6 | import org.eclipse.rdf4j.query.TupleQueryResult; 7 | 8 | import fr.lirmm.graphik.graal.api.core.Substitution; 9 | import fr.lirmm.graphik.graal.api.core.Term; 10 | import fr.lirmm.graphik.graal.api.core.Variable; 11 | import fr.lirmm.graphik.graal.common.rdf4j.RDF4jUtils; 12 | import fr.lirmm.graphik.graal.core.TreeMapSubstitution; 13 | import fr.lirmm.graphik.util.stream.converter.ConversionException; 14 | import fr.lirmm.graphik.util.stream.converter.Converter; 15 | 16 | public class TupleQueryResult2SubstitutionConverter implements Converter { 17 | 18 | private List ans; 19 | private RDF4jUtils utils; 20 | 21 | public TupleQueryResult2SubstitutionConverter(List ans, RDF4jUtils utils) { 22 | this.ans = ans; 23 | this.utils = utils; 24 | } 25 | 26 | @Override 27 | public Substitution convert(TupleQueryResult object) throws ConversionException { 28 | Substitution substitution = new TreeMapSubstitution(); 29 | if (object.hasNext()) { 30 | BindingSet bindingSet = object.next(); 31 | for (Term var : ans) { 32 | Term value = utils.valueToTerm(bindingSet.getValue(var.getLabel())); 33 | substitution.put((Variable) var, value); 34 | } 35 | } 36 | return substitution; 37 | } 38 | } -------------------------------------------------------------------------------- /graal-store/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | fr.lirmm.graphik 6 | graal 7 | 1.3.2-SNAPSHOT 8 | 9 | 10 | graal-store 11 | fr.lirmm.graphik:graal-store 12 | pom 13 | 14 | 15 | 16 | Clément SIPIETER 17 | clement@6pi.fr 18 | INRIA 19 | 20 | 21 | 22 | 23 | graal-store-rdbms 24 | graal-store-neo4j 25 | graal-store-rdf4j 26 | graal-store-dictionary 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /graal-test/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-test/src/test/java/fr/lirmm/graphik/graal/test/RulesCompilationFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.graal.test; 44 | 45 | import fr.lirmm.graphik.graal.api.core.RulesCompilation; 46 | 47 | /** 48 | * @author Clément Sipieter (INRIA) {@literal } 49 | * 50 | */ 51 | public interface RulesCompilationFactory { 52 | 53 | RulesCompilation create(); 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /graal-test/src/test/resources/ontologies/1.dlp: -------------------------------------------------------------------------------- 1 | @rules 2 | 3 | t(X,Z):-q(X). %non compilable 4 | q(X),s(X):-p(X). %compilable : il ne faut pas se faire piéger par la tête non-atomique 5 | p(X):-r(X,Z). %compilable 6 | 7 | @facts 8 | 9 | r(a,a). 10 | 11 | %Dérivation (saturation) à partir de r(a,a) sans compilation 12 | %r(a,a) -> p(a) -> q(a),s(a) -> t(a,Z0) 13 | 14 | %Dérivation (saturation) à partir de r(a,a) avec compilation 15 | %r(a,a) -> t(a,Z0) -------------------------------------------------------------------------------- /graal-test/src/test/resources/ontologies/1_compile-result.dlp: -------------------------------------------------------------------------------- 1 | @facts 2 | 3 | r(a,a). 4 | t(a,Z0). -------------------------------------------------------------------------------- /graal-test/src/test/resources/ontologies/1_result.dlp: -------------------------------------------------------------------------------- 1 | @facts 2 | 3 | r(a,a). 4 | p(a). 5 | q(a). 6 | s(a). 7 | t(a,Z0). -------------------------------------------------------------------------------- /graal-test/src/test/resources/ontologies/2.dlp: -------------------------------------------------------------------------------- 1 | @rules 2 | 3 | t(X,Z):-q(X,X). %non compilable, et unification impossible 4 | q(X,X):-p(X,X). %compilable, et unification du body impossible avec la tête de la règle suivante 5 | p(Y,X):-r(X). %non compilable 6 | r(X):-s(X). %compilable 7 | 8 | 9 | @facts 10 | 11 | s(a). 12 | 13 | %Dérivation (saturation) à partir de s(a) sans compilation 14 | 15 | %s(a) -> r(a) -> p(Y0,a) -> (fin : impossible d'appliquer q(X,X):-p(X,X)) 16 | 17 | %Dérivation (saturation) à partir de s(a) avec compilation 18 | 19 | %s(a) -> p(Y0,a) -> (fin : impossible d'appliquer q(X,X):-p(X,X)) -------------------------------------------------------------------------------- /graal-test/src/test/resources/ontologies/2_compile-result.dlp: -------------------------------------------------------------------------------- 1 | @facts 2 | 3 | s(a). 4 | p(Y0,a). -------------------------------------------------------------------------------- /graal-test/src/test/resources/ontologies/2_result.dlp: -------------------------------------------------------------------------------- 1 | @facts 2 | 3 | s(a). 4 | r(a). 5 | p(Y0,a). -------------------------------------------------------------------------------- /graal-test/src/test/resources/ontologies/3.dlp: -------------------------------------------------------------------------------- 1 | @rules 2 | 3 | win(Y,X,Z):-rotate(Y,X,X). % non-compilable, et unification possible (après plusieurs applications de la règle suivante) 4 | rotate(X1,X2,X3):-rotate(X2,X3,X1). % compilable 5 | rotate(X,X,Y):-start(X). % compilable 6 | 7 | @facts 8 | 9 | start(a). 10 | 11 | %Dérivation (saturation) à partir de start(a) avec compilation 12 | 13 | %start(a) -> rotate(a,a,Y0) -> rotate(a,Y0,a) -> rotate(Y0,a,a) -> win(Y0,a,Z0) 14 | 15 | %Dérivation (saturation) à partir de start(a) sans compilation 16 | 17 | %start(a) -> win(Y0,a,Z0) -------------------------------------------------------------------------------- /graal-test/src/test/resources/ontologies/3_compile-result.dlp: -------------------------------------------------------------------------------- 1 | @facts 2 | 3 | start(a). 4 | rotate(a,a,Y), win(Y,a,Z0). -------------------------------------------------------------------------------- /graal-test/src/test/resources/ontologies/3_result.dlp: -------------------------------------------------------------------------------- 1 | @facts 2 | 3 | start(a). 4 | rotate(a,a,Y), rotate(a,Y,a), rotate(Y,a,a), win(Y,a,Z). -------------------------------------------------------------------------------- /graal-util/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /graal-util/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | fr.lirmm.graphik 6 | graal 7 | 1.3.2-SNAPSHOT 8 | 9 | 10 | graal-util 11 | jar 12 | fr.lirmm.graphik:graal-util 13 | 14 | 15 | 16 | Clément SIPIETER 17 | clement@6pi.fr 18 | INRIA 19 | 20 | 21 | 22 | 23 | 24 | org.apache.commons 25 | commons-lang3 26 | 3.5 27 | 28 | 29 | org.jgrapht 30 | jgrapht-core 31 | ${jgrapht.version} 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/ArrayIterator.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.util; 2 | 3 | import java.util.Iterator; 4 | 5 | 6 | public class ArrayIterator implements Iterator { 7 | public T[] array; 8 | int i = 0; 9 | 10 | @SafeVarargs 11 | public ArrayIterator(T... array) { 12 | this.array = array; 13 | } 14 | 15 | @Override 16 | public boolean hasNext() { 17 | return i < array.length; 18 | } 19 | 20 | @Override 21 | public T next() { 22 | return array[i++]; 23 | } 24 | 25 | @Override 26 | public void remove() { 27 | throw new UnsupportedOperationException(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/collections/Trie.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.util.collections; 2 | 3 | public class Trie 4 | { 5 | private TrieNode root; 6 | 7 | /** 8 | * Constructor 9 | */ 10 | public Trie() 11 | { 12 | root = new TrieNode(); 13 | } 14 | 15 | /** 16 | * Associates a value to a word 17 | * 18 | * @param value 19 | * @param word 20 | */ 21 | @SafeVarargs 22 | public final V put(V value, T... word) 23 | { 24 | return root.put(value, 0, word); 25 | } 26 | 27 | /** 28 | * Get the value in the Trie with the given 29 | * word 30 | * 31 | * @param word 32 | * @return the associated value, or null if there is no value associated. 33 | */ 34 | @SafeVarargs 35 | public final V get(T... word) 36 | { 37 | return root.get(0, word); 38 | } 39 | } -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/collections/TrieNode.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.util.collections; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | class TrieNode { 7 | 8 | private Map> children; 9 | private boolean isLeaf; // quick way to check if any children exist 10 | private V value; // the associated value to this word, if exist. 11 | 12 | // ///////////////////////////////////////////////////////////////////////// 13 | // CONSTRUCTORS 14 | // ///////////////////////////////////////////////////////////////////////// 15 | 16 | public TrieNode() { 17 | children = new HashMap>(); 18 | isLeaf = true; 19 | } 20 | 21 | // ///////////////////////////////////////////////////////////////////////// 22 | // PUBLIC METHODS 23 | // ///////////////////////////////////////////////////////////////////////// 24 | 25 | /** 26 | * Adds a word to this node. This method is called recursively and adds 27 | * child nodes for each successive letter in the word, therefore recursive 28 | * calls will be made with partial words. 29 | * 30 | * @param word 31 | * the word to add 32 | */ 33 | @SafeVarargs 34 | public final V put(V value, int index, T... word) { 35 | if (word.length <= index) { 36 | V tmp = this.value; 37 | this.value = value; 38 | return tmp; 39 | } else { 40 | isLeaf = false; 41 | T charac = word[index]; 42 | TrieNode child = children.get(charac); 43 | if (child == null) { 44 | child = new TrieNode(); 45 | children.put(charac, child); 46 | } 47 | return child.put(value, index + 1, word); 48 | } 49 | } 50 | 51 | /** 52 | * 53 | * @return the associated value to the specified word. 54 | */ 55 | @SafeVarargs 56 | public final V get(int index, T... word) { 57 | if (word.length <= index) { 58 | return this.value; 59 | } else { 60 | if(isLeaf) { 61 | return null; 62 | } else { 63 | T charac = word[index]; 64 | TrieNode child = children.get(charac); 65 | if(child == null) { 66 | return null; 67 | } else { 68 | return child.get(index + 1, word); 69 | } 70 | } 71 | } 72 | } 73 | 74 | 75 | } -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/graph/DirectedEdge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.graph; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public interface DirectedEdge extends Edge { 50 | 51 | int getTail(); 52 | 53 | int getHead(); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/graph/Edge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.graph; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public interface Edge { 50 | 51 | int getFirst(); 52 | 53 | int getSecond(); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/graph/HyperEdge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.graph; 44 | 45 | import java.util.Iterator; 46 | 47 | /** 48 | * @author Clément Sipieter (INRIA) {@literal } 49 | * 50 | */ 51 | public interface HyperEdge { 52 | 53 | Iterator vertices(); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/profiler/Profilable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.util.profiler; 47 | 48 | /** 49 | * @author Clément Sipieter (INRIA) {@literal } 50 | * 51 | */ 52 | public interface Profilable { 53 | 54 | void setProfiler(Profiler profiler); 55 | 56 | Profiler getProfiler(); 57 | 58 | } 59 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/AbstractCloseableIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.stream; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public abstract class AbstractCloseableIterator implements CloseableIterator { 50 | 51 | @Override 52 | protected void finalize() throws Throwable { 53 | this.close(); 54 | super.finalize(); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/ArrayCloseableIterator.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.util.stream; 2 | 3 | 4 | public class ArrayCloseableIterator extends AbstractCloseableIterator { 5 | 6 | private T[] array; 7 | private int indexIt = 0; 8 | 9 | public ArrayCloseableIterator(T... args) { 10 | array = args; 11 | } 12 | 13 | @Override 14 | public boolean hasNext() throws IteratorException { 15 | return indexIt < array.length; 16 | } 17 | 18 | @Override 19 | public T next() throws IteratorException { 20 | return array[indexIt++]; 21 | } 22 | 23 | @Override 24 | public void close() { 25 | // do nothing 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/CloseableIterable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.stream; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public interface CloseableIterable { 50 | 51 | CloseableIterator iterator(); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/CloseableIterableWithoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.stream; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public interface CloseableIterableWithoutException extends CloseableIterable { 50 | 51 | @Override 52 | CloseableIteratorWithoutException iterator(); 53 | } 54 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/CloseableIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.stream; 44 | 45 | import java.io.Closeable; 46 | 47 | 48 | 49 | /** 50 | * @author Clément Sipieter (INRIA) {@literal } 51 | * 52 | */ 53 | public interface CloseableIterator extends Closeable { 54 | 55 | boolean hasNext() throws IteratorException; 56 | 57 | T next() throws IteratorException; 58 | 59 | @Override 60 | public void close(); 61 | 62 | } 63 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/CloseableIteratorAccumulator.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.util.stream; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * This Iterator stores the items passed in a buffer memory. 8 | * 9 | * @author Olivier Rodriguez 10 | */ 11 | public class CloseableIteratorAccumulator extends AbstractCloseableIterator { 12 | private CloseableIterator it; 13 | List accu = new ArrayList<>(); 14 | boolean hasNext = false; 15 | boolean nextIsStore = false; 16 | 17 | // ///////////////////////////////////////////////////////////////////////// 18 | // CONSTRUCTOR 19 | // ///////////////////////////////////////////////////////////////////////// 20 | 21 | public CloseableIteratorAccumulator(CloseableIterator it) throws IteratorException { 22 | this.it = it; 23 | hasNext = it.hasNext(); 24 | } 25 | 26 | // ///////////////////////////////////////////////////////////////////////// 27 | // METHODS 28 | // ///////////////////////////////////////////////////////////////////////// 29 | 30 | @Override 31 | public boolean hasNext() throws IteratorException { 32 | 33 | if (nextIsStore) { 34 | hasNext = it.hasNext(); 35 | nextIsStore = false; 36 | } 37 | return hasNext; 38 | } 39 | 40 | @Override 41 | public E next() throws IteratorException { 42 | E ret = it.next(); 43 | 44 | if (!nextIsStore) { 45 | accu.add(ret); 46 | nextIsStore = true; 47 | } 48 | return ret; 49 | } 50 | 51 | @Override 52 | public void close() { 53 | it.close(); 54 | } 55 | 56 | /** 57 | * Consume the iterator (iterate until the last element). 58 | * 59 | * @return 60 | * @throws IteratorException 61 | */ 62 | public CloseableIteratorAccumulator consumeAll() throws IteratorException { 63 | 64 | while (hasNext()) 65 | next(); 66 | 67 | return this; 68 | } 69 | 70 | @SuppressWarnings("unchecked") 71 | public E[] toArray() { 72 | return (E[]) accu.toArray(); 73 | } 74 | 75 | public List getList() { 76 | // Get a copy for not being able to modify the $accu outside. 77 | return new ArrayList<>(accu); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/CloseableIteratorRecursive.java: -------------------------------------------------------------------------------- 1 | package fr.lirmm.graphik.util.stream; 2 | 3 | import java.util.Stack; 4 | 5 | /** 6 | * This Iterator iterate recursively on Iterator or CloseableIterable results 7 | * from a primary iterator. 8 | * 9 | * @author Olivier Rodriguez 10 | */ 11 | public class CloseableIteratorRecursive extends AbstractCloseableIterator { 12 | 13 | private Stack> stackIterator; 14 | private CloseableIterator currentIterator; 15 | private E next; 16 | 17 | // ///////////////////////////////////////////////////////////////////////// 18 | // CONSTRUCTOR 19 | // ///////////////////////////////////////////////////////////////////////// 20 | 21 | public CloseableIteratorRecursive(CloseableIterator primaryIterator) { 22 | stackIterator = new Stack<>(); 23 | currentIterator = primaryIterator; 24 | } 25 | 26 | // ///////////////////////////////////////////////////////////////////////// 27 | // METHODS 28 | // ///////////////////////////////////////////////////////////////////////// 29 | 30 | @SuppressWarnings("unchecked") 31 | @Override 32 | public boolean hasNext() throws IteratorException { 33 | 34 | if (next != null) 35 | return true; 36 | 37 | if (currentIterator == null) 38 | return false; 39 | 40 | while (!currentIterator.hasNext()) { 41 | currentIterator.close(); 42 | 43 | if (stackIterator.isEmpty()) { 44 | currentIterator = null; 45 | return false; 46 | } 47 | currentIterator = stackIterator.pop(); 48 | } 49 | E next = currentIterator.next(); 50 | 51 | if (next instanceof CloseableIterator) { 52 | stackIterator.push(currentIterator); 53 | currentIterator = (CloseableIterator) next; 54 | return currentIterator.hasNext(); 55 | } else if (next instanceof CloseableIterable) { 56 | stackIterator.push(currentIterator); 57 | currentIterator = ((CloseableIterable) next).iterator(); 58 | return currentIterator.hasNext(); 59 | } 60 | this.next = next; 61 | return true; 62 | } 63 | 64 | @Override 65 | public E next() throws IteratorException { 66 | 67 | if (next == null) 68 | this.hasNext(); 69 | 70 | E ret = next; 71 | next = null; 72 | return ret; 73 | } 74 | 75 | @Override 76 | public void close() { 77 | 78 | if (currentIterator == null) 79 | return; 80 | 81 | currentIterator.close(); 82 | 83 | while (!stackIterator.isEmpty()) { 84 | stackIterator.pop().close(); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/CloseableIteratorWithoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.stream; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public interface CloseableIteratorWithoutException extends CloseableIterator { 50 | 51 | @Override 52 | boolean hasNext(); 53 | 54 | @Override 55 | T next(); 56 | 57 | } 58 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/EmptyCloseableIteratorWithoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.stream; 44 | 45 | class EmptyCloseableIteratorWithoutException implements CloseableIteratorWithoutException { 46 | @Override 47 | public void close() { 48 | } 49 | 50 | @Override 51 | public boolean hasNext() { 52 | return false; 53 | } 54 | 55 | @Override 56 | public T next() { 57 | return null; 58 | } 59 | } -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/InMemoryStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.stream; 44 | 45 | import java.util.Iterator; 46 | 47 | /** 48 | * @author Clément Sipieter (INRIA) {@literal } 49 | * 50 | */ 51 | public interface InMemoryStream extends Stream, CloseableIteratorWithoutException { 52 | 53 | @Override 54 | void write(T object); 55 | 56 | @Override 57 | void write(Iterator objects); 58 | 59 | } 60 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/Stream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.stream; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public interface Stream extends CloseableIterator, Writer { 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/Writer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.stream; 44 | 45 | import java.io.IOException; 46 | import java.util.Iterator; 47 | 48 | public interface Writer { 49 | 50 | void write(T object) throws IOException; 51 | 52 | void write(Iterator objects) throws IOException; 53 | } 54 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/converter/Converter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.stream.converter; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public interface Converter { 50 | 51 | T convert(U object) throws ConversionException; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/filter/FalseFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.stream.filter; 44 | 45 | /** 46 | * This Filter always return false. 47 | * 48 | * @author Clément Sipieter (INRIA) {@literal } 49 | * 50 | * @param 51 | */ 52 | class FalseFilter implements Filter { 53 | 54 | @Override 55 | public boolean filter(E e) { 56 | return false; 57 | } 58 | } -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/filter/TrueFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.stream.filter; 44 | 45 | /** 46 | * This Filter always return true. 47 | * 48 | * @author Clément Sipieter (INRIA) {@literal } 49 | * 50 | * @param 51 | */ 52 | class TrueFilter implements Filter { 53 | 54 | @Override 55 | public boolean filter(Object e) { 56 | return true; 57 | } 58 | } -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/stream/transformator/Transformator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.util.stream.transformator; 47 | 48 | /** 49 | * @author Clément Sipieter (INRIA) {@literal } 50 | * 51 | */ 52 | public interface Transformator { 53 | 54 | /** 55 | * Transform an instance of U into an instance of T. 56 | * 57 | * @param u 58 | * the instance to transform. 59 | * @return an instance of T. 60 | */ 61 | T transform(U u); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/string/AppendableToStringBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | /** 44 | * 45 | */ 46 | package fr.lirmm.graphik.util.string; 47 | 48 | /** 49 | * @author Clément Sipieter (INRIA) {@literal } 50 | * 51 | */ 52 | public interface AppendableToStringBuilder { 53 | 54 | void appendTo(StringBuilder sb); 55 | } 56 | -------------------------------------------------------------------------------- /graal-util/src/main/java/fr/lirmm/graphik/util/string/StringUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Inria Sophia Antipolis - Méditerranée / LIRMM 3 | * (Université de Montpellier & CNRS) (2014 - 2017) 4 | * 5 | * Contributors : 6 | * 7 | * Clément SIPIETER 8 | * Mélanie KÖNIG 9 | * Swan ROCHER 10 | * Jean-François BAGET 11 | * Michel LECLÈRE 12 | * Marie-Laure MUGNIER 13 | * 14 | * 15 | * This file is part of Graal . 16 | * 17 | * This software is governed by the CeCILL license under French law and 18 | * abiding by the rules of distribution of free software. You can use, 19 | * modify and/ or redistribute the software under the terms of the CeCILL 20 | * license as circulated by CEA, CNRS and INRIA at the following URL 21 | * "http://www.cecill.info". 22 | * 23 | * As a counterpart to the access to the source code and rights to copy, 24 | * modify and redistribute granted by the license, users are provided only 25 | * with a limited warranty and the software's author, the holder of the 26 | * economic rights, and the successive licensors have only limited 27 | * liability. 28 | * 29 | * In this respect, the user's attention is drawn to the risks associated 30 | * with loading, using, modifying and/or developing or reproducing the 31 | * software by the user in light of its specific status of free software, 32 | * that may mean that it is complicated to manipulate, and that also 33 | * therefore means that it is reserved for developers and experienced 34 | * professionals having in-depth computer knowledge. Users are therefore 35 | * encouraged to load and test the software's suitability as regards their 36 | * requirements in conditions enabling the security of their systems and/or 37 | * data to be ensured and, more generally, to use and operate it in the 38 | * same conditions as regards security. 39 | * 40 | * The fact that you are presently reading this means that you have had 41 | * knowledge of the CeCILL license and that you accept its terms. 42 | */ 43 | package fr.lirmm.graphik.util.string; 44 | 45 | /** 46 | * @author Clément Sipieter (INRIA) {@literal } 47 | * 48 | */ 49 | public final class StringUtils { 50 | 51 | private StringUtils() { 52 | } 53 | 54 | public static String addSlashes(String s) { 55 | return s.replaceAll("'", "\\\\'"); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /prepare_ant.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # add all libraries to the build.xml file 3 | 4 | ./scripts/wget-dep.sh 5 | 6 | LIBS=$(ls -l ./lib | head -n 2 | tail -n 1 | perl -n -e '/.* (.*)/ && print "lib/$1"') 7 | LIBS=${LIBS}$(ls -l ./lib | tail -n +2 | perl -n -e '/.* (.*)/ && print ":lib/$1"') 8 | 9 | cat scripts/build.xml.prefix > build.xml 10 | echo "" >> build.xml 11 | cat scripts/build.xml.suffix >> build.xml 12 | -------------------------------------------------------------------------------- /rdf4j-common/config: -------------------------------------------------------------------------------- 1 | ../config -------------------------------------------------------------------------------- /rdf4j-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | fr.lirmm.graphik 6 | graal 7 | 1.3.2-SNAPSHOT 8 | 9 | 10 | rdf4j-common 11 | jar 12 | fr.lirmm.graphik:rdf4j-common 13 | 14 | 15 | 1.0.3 16 | 17 | 18 | 19 | 20 | Clément SIPIETER 21 | clement@6pi.fr 22 | INRIA 23 | 24 | 25 | 26 | 27 | 28 | fr.lirmm.graphik 29 | graal-core 30 | ${project.parent.version} 31 | 32 | 33 | fr.lirmm.graphik 34 | graal-util 35 | ${project.parent.version} 36 | 37 | 38 | org.eclipse.rdf4j 39 | rdf4j-model 40 | ${rdf4j.version} 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /scripts/build.xml.prefix: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /scripts/dep-list-create.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | mvn dependency:list | grep ":compile" | grep -v graal | grep -v SNAPSHOT | sort | uniq | sed 's/\[INFO\]\s*\([^ ]*\):compile.*/\1/' | sed 's/:jar//' | perl -n -e 'my $t; if (/(.*?):(.*)/) {$t = $2;} $_ = $1; s/[.:]/\//g; print "$_/$t\n"' | perl -n -e '/(.*)\/(.*)\/(.*)/ && print "/$1/$2/$3/$3.jar\n"' | sed 's-:-/-' | sed 's.:.-.' 3 | -------------------------------------------------------------------------------- /scripts/kiabora_combiner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | KIABORA="./apps/graal-kiabora.sh" 4 | COMBINER="./tools/kiabora_to_combine.pl" 5 | 6 | INPUT=$1 7 | if [ ${INPUT} -eq ""]; then 8 | INPUT="-" 9 | fi 10 | ${KIABORA} -p \* -r -s -c -b -f ${INPUT} 2> /dev/null | ${COMBINER} $2 2> /dev/null 11 | 12 | -------------------------------------------------------------------------------- /scripts/wget-dep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | mkdir -p ./lib 3 | cd ./lib 4 | 5 | while read dep 6 | do 7 | if [ ! -f $(basename $dep) ] 8 | then 9 | wget https://repo1.maven.org/maven2$dep 10 | fi 11 | done < ../scripts/dep-list 12 | --------------------------------------------------------------------------------